Merge pull request #184 from TheSerapher/issue-91

Adding block luck graph
This commit is contained in:
Sebastian Grewe 2013-06-13 07:27:23 -07:00
commit 48d8d23efa
4 changed files with 74 additions and 13 deletions

View File

@ -13,5 +13,5 @@ $aBlockData = $aBlocksFoundData[0];
$smarty->assign("BLOCKSFOUND", $aBlocksFoundData);
$smarty->assign("BLOCKLIMIT", $iLimit);
$smarty->assign("CONTENT", "blocks_found.tpl");
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -0,0 +1,70 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Block Luck" BLOCK_STYLE="clear:none;"}
<table class="stats" style="">
<thead>
<tr>
{section block $BLOCKSFOUND}
<th scope="col">{$BLOCKSFOUND[block].height}</th>
{/section}
</th>
</thead>
<tbody>
<tr>
<th scope="row">Expected Shares</th>
{section block $BLOCKSFOUND}
<td>{(pow(2,32 - $GLOBAL.config.targetdiff) * $BLOCKSFOUND[block].difficulty)}</td>
{/section}
</tr>
<tr>
<th scope="row">Actual Shares</th>
{section block $BLOCKSFOUND}
<td>{$BLOCKSFOUND[block].shares}</td>
{/section}
</tr>
</tbody>
</table>
<center><br>
<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
target and network difficulty and assuming a zero variance scenario.
</p></center>
{include file="global/block_footer.tpl"}
{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
<center>
<table width="100%" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th class="center">Block</th>
<th class="center">Validity</th>
<th>Finder</th>
<th class="center">Time</th>
<th class="right">Difficulty</th>
<th class="right">Expected Shares</th>
<th class="right">Actual Shares</th>
</tr>
</thead>
<tbody>
{assign var=rank value=1}
{section block $BLOCKSFOUND}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$GLOBAL.blockexplorer}{$BLOCKSFOUND[block].height}" target="_blank">{$BLOCKSFOUND[block].height}</a></td>
<td class="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKSFOUND[block].confirmations == -1}
<font color="red">Orphan</font>
{else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if}</td>
<td>{$BLOCKSFOUND[block].finder|default:"unknown"}</td>
<td class="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
<td class="right">{$BLOCKSFOUND[block].difficulty|number_format:"2"}</td>
<td class="right">{(pow(2,32 - $GLOBAL.config.targetdiff) * $BLOCKSFOUND[block].difficulty)|number_format}</td>
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>
</tr>
{/section}
</tbody>
</table>
</center>
<ul>
<li>Note: <font color="orange">Round Earnings are not credited until {$GLOBAL.confirmations} confirms.</font></li>
</ul>
{include file="global/block_footer.tpl"}

View File

@ -1,14 +1,12 @@
{include file="global/block_header.tpl" BLOCK_HEADER="Last $BLOCKLIMIT Blocks Found" BLOCK_STYLE="clear:none;"}
<center>
<table class="stats_lastblocks" width="100%" style="font-size:13px;">
<table width="100%" style="font-size:13px;">
<thead>
<tr style="background-color:#B6DAFF;">
<th class="center">Block</th>
<th class="center">Validity</th>
<th>Finder</th>
<th class="center">Time</th>
<th class="right">Difficulty</th>
<th class="right">Shares</th>
<th class="right">Actual Shares</th>
</tr>
</thead>
<tbody>
@ -16,15 +14,8 @@
{section block $BLOCKSFOUND}
<tr class="{cycle values="odd,even"}">
<td class="center"><a href="{$GLOBAL.blockexplorer}{$BLOCKSFOUND[block].height}" target="_blank">{$BLOCKSFOUND[block].height}</a></td>
<td class="center">
{if $BLOCKSFOUND[block].confirmations >= $GLOBAL.confirmations}
<font color="green">Confirmed</font>
{else if $BLOCKSFOUND[block].confirmations == -1}
<font color="red">Orphan</font>
{else}{$GLOBAL.confirmations - $BLOCKSFOUND[block].confirmations} left{/if}</td>
<td>{$BLOCKSFOUND[block].finder|default:"unknown"}</td>
<td class="center">{$BLOCKSFOUND[block].time|date_format:"%d/%m %H:%M:%S"}</td>
<td class="right">{$BLOCKSFOUND[block].difficulty|number_format:"2"}</td>
<td class="right">{$BLOCKSFOUND[block].shares|number_format}</td>
</tr>
{/section}

View File

@ -44,6 +44,6 @@
{include file="global/block_footer.tpl"}
{include file="statistics/blocks/blocks_found.tpl" ALIGN="right"}
{include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true}
{include file="global/block_footer.tpl"}