[FEATURE] added block finding rate - HINT new config setting cointarget

This commit is contained in:
root 2013-11-07 12:14:37 +01:00
parent 90a000e7ee
commit 9fa40eaf45
6 changed files with 54 additions and 17 deletions

View File

@ -152,6 +152,20 @@ $config['accounts']['invitations']['count'] = 5;
// Currency system used in this pool, default: `LTC`
$config['currency'] = 'LTC';
/**
* Coin Target in seconds
*
* Explanation
* Target time for coins to be generated
*
* Fastcoin: 12 seconds
* Litecoin: 2,5 minutes = 150 seconds
* Feathercoin: 2,5 minutes = 150 seconds
* Bitcoin: 10 minutes = 600 seconds
*
**/
$config['cointarget'] = '12';
/**
* Default transaction fee to apply to user transactions
*

View File

@ -70,12 +70,16 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
}
$iHours = 24;
$now = new DateTime( "now" );
$aPoolStatistics = $statistics->getPoolStatsHours($iHours);
$iFirstBlockFound = $statistics->getFirstBlockFound();
$iTimeSinceFirstBlockFound = ($now->getTimestamp() - $iFirstBlockFound);
// Past blocks found, max 4 weeks back
$iFoundBlocksByTime = $statistics->getLastBlocksbyTime();
// Propagate content our template
$smarty->assign("FIRSTBLOCKFOUND", $iTimeSinceFirstBlockFound);
$smarty->assign("COINGENTIME", $config['cointarget']);
$smarty->assign("LASTBLOCKSBYTIME", $iFoundBlocksByTime);
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
$smarty->assign("BLOCKLIMIT", $iLimit);

View File

@ -4,42 +4,62 @@
<thead>
<tr>
<th align="left"></th>
<th align="center">Gen</th>
<th align="center">Found</th>
<th align="center">Valid</th>
<th align="center">Orphan</th>
<th align="center">Rate</th>
</tr>
</thead>
<tbody>
<tr>
<th align="left" style="padding-left: 15px">All Time</td>
<td align="center">{($FIRSTBLOCKFOUND / $COINGENTIME)}</td>
<td align="center">{$LASTBLOCKSBYTIME.Total}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.TotalOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.Total|default:"0.00" / (3600 / $COINGENTIME) * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last Hour</td>
<td align="center">{(3600 / $COINGENTIME)}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.1HourOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.1HourTotal|default:"0.00" / (3600 / $COINGENTIME) * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 24 Hours</td>
<td align="center">{(86400 / $COINGENTIME)}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.24HourOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.24HourTotal|default:"0.00" / (86400 / $COINGENTIME) * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 7 Days</td>
<td align="center">{(604800 / $COINGENTIME)}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.7DaysOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.7DaysTotal|default:"0.00" / (604800 / $COINGENTIME) * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 4 Weeks</td>
<td align="center">{(2419200 / $COINGENTIME)}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.4WeeksOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.4WeeksTotal|default:"0.00" / (2419200 / $COINGENTIME) * 100)|number_format:"2"} %</td>
</tr>
<tr>
<th align="left" style="padding-left: 15px">Last 12 Month</td>
<td align="center">{(29030400 / $COINGENTIME)}</td>
<td align="center">{$LASTBLOCKSBYTIME.12MonthTotal}</td>
<td align="center">{$LASTBLOCKSBYTIME.12MonthValid}</td>
<td align="center">{$LASTBLOCKSBYTIME.12MonthOrphan}</td>
<td align="center">{($LASTBLOCKSBYTIME.12MonthTotal|default:"0.00" / (29030400 / $COINGENTIME) * 100)|number_format:"2"} %</td>
</tr>
</tbody>
</table>
</article>
</article>

View File

@ -36,6 +36,18 @@
</tr>{/if}
</tbody>
</table>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
<footer>
<p style="padding-left:30px; padding-redight:30px; font-size:10px;">
The graph above illustrates N shares to find a block vs. E Shares expected to find a block based on

View File

@ -24,17 +24,4 @@
</tr>
</tbody>
</table>
<table class="tablesorter">
<tbody>
<tr>
<td align="left">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > ($BLOCKLIMIT - 1)}{$BLOCKSFOUND[$BLOCKLIMIT - 1].height}{/if}&prev=1"><i class="icon-left-open"></i></a>
</td>
<td align="right">
<a href="{$smarty.server.PHP_SELF}?page={$smarty.request.page}&action={$smarty.request.action}&height={if is_array($BLOCKSFOUND) && count($BLOCKSFOUND) > 0}{$BLOCKSFOUND[0].height}{/if}&next=1"><i class="icon-right-open"></i></a>
</td>
</tr>
</tbody>
</table>
</article>

View File

@ -1,4 +1,4 @@
{include file="statistics/blocks/block_shares_graph.tpl"}
{include file="statistics/blocks/block_overview_time.tpl"}
{include file="statistics/blocks/block_shares_time.tpl"}
{include file="statistics/blocks/block_shares_graph.tpl"}
{include file="statistics/blocks/blocks_found_details.tpl"}