Merge pull request #936 from TheSerapher/issue-934

[FIX] Network hashrate in dashboard
This commit is contained in:
Sebastian Grewe 2013-12-09 07:12:27 -08:00
commit eefb3a213a
4 changed files with 18 additions and 6 deletions

View File

@ -41,6 +41,14 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$dTimeSinceLast = 0; $dTimeSinceLast = 0;
} }
// Round progress
$iEstShares = $statistics->getEstimatedShares($dDifficulty);
if ($iEstShares > 0 && $aRoundShares['valid'] > 0) {
$dEstPercent = round(100 / $iEstShares * $aRoundShares['valid'], 2);
} else {
$dEstPercent = 0;
}
// Propagate content our template // Propagate content our template
$smarty->assign("ESTTIME", $iEstTime); $smarty->assign("ESTTIME", $iEstTime);
$smarty->assign("TIMESINCELAST", $dTimeSinceLast); $smarty->assign("TIMESINCELAST", $dTimeSinceLast);
@ -50,6 +58,8 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
$smarty->assign("CONTRIBHASHES", $aContributorsHashes); $smarty->assign("CONTRIBHASHES", $aContributorsHashes);
$smarty->assign("CURRENTBLOCK", $iBlock); $smarty->assign("CURRENTBLOCK", $iBlock);
$smarty->assign("CURRENTBLOCKHASH", @$sBlockHash); $smarty->assign("CURRENTBLOCKHASH", @$sBlockHash);
$smarty->assign('NETWORK', array('difficulty' => $dDifficulty, 'block' => $iBlock));
$smarty->assign('ESTIMATES', array('shares' => $iEstShares, 'percent' => $dEstPercent));
if (count($aBlockData) > 0) { if (count($aBlockData) > 0) {
$smarty->assign("LASTBLOCK", $aBlockData['height']); $smarty->assign("LASTBLOCK", $aBlockData['height']);
$smarty->assign("LASTBLOCKHASH", $aBlockData['blockhash']); $smarty->assign("LASTBLOCKHASH", $aBlockData['blockhash']);

View File

@ -35,7 +35,7 @@ if ( ! $dPersonalHashrateModifier = $setting->getValue('statistics_personal_hash
if ( ! $dNetworkHashrateModifier = $setting->getValue('statistics_network_hashrate_modifier') ) $dNetworkHashrateModifier = 1; if ( ! $dNetworkHashrateModifier = $setting->getValue('statistics_network_hashrate_modifier') ) $dNetworkHashrateModifier = 1;
// Apply modifier now // Apply modifier now
$dNetworkHashrate = $dNetworkHashrate * $dNetworkHashrateModifier; $dNetworkHashrate = $dNetworkHashrate / 1000 * $dNetworkHashrateModifier;
$iCurrentPoolHashrate = $iCurrentPoolHashrate * $dPoolHashrateModifier; $iCurrentPoolHashrate = $iCurrentPoolHashrate * $dPoolHashrateModifier;
// Share rate of the entire pool // Share rate of the entire pool

View File

@ -6,4 +6,6 @@
{include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true} {include file="statistics/blocks/small_table.tpl" ALIGN="right" SHORT=true}
{if !$GLOBAL.website.api.disabled}
{include file="statistics/js.tpl"} {include file="statistics/js.tpl"}
{/if}

View File

@ -5,7 +5,7 @@
<tbody> <tbody>
<tr> <tr>
<th align="left" width="50%">Pool Hash Rate</th> <th align="left" width="50%">Pool Hash Rate</th>
<td width="70%"><span id="b-hashrate"></span> {$GLOBAL.hashunits.pool}</td> <td width="70%"><span id="b-hashrate">{$GLOBAL.hashrate|number_format:"3"}</span> {$GLOBAL.hashunits.pool}</td>
</tr> </tr>
<tr> <tr>
<th align="left">Pool Efficiency</td> <th align="left">Pool Efficiency</td>
@ -13,14 +13,14 @@
</tr> </tr>
<tr> <tr>
<th align="left">Current Active Workers</td> <th align="left">Current Active Workers</td>
<td id="b-workers"></td> <td id="b-workers">{$GLOBAL.workers}</td>
</tr> </tr>
<tr> <tr>
<th align="left">Current Difficulty</td> <th align="left">Current Difficulty</td>
{if ! $GLOBAL.website.chaininfo.disabled} {if ! $GLOBAL.website.chaininfo.disabled}
<td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2"><span id="b-diff"></span></font></a></td> <td><a href="{$GLOBAL.website.chaininfo.url}" target="_new"><font size="2"><span id="b-diff">{$NETWORK.difficulty}</span></font></a></td>
{else} {else}
<td><font size="2"><span id="b-diff"></span></font></td> <td><font size="2"><span id="b-diff">{$NETWORK.difficulty}</span></font></td>
{/if} {/if}
</tr> </tr>
<tr> <tr>
@ -29,7 +29,7 @@
</tr> </tr>
<tr> <tr>
<th align="left">Est. Shares this Round</td> <th align="left">Est. Shares this Round</td>
<td id="b-target"></td> <td id="b-target">{$ESTIMATES.shares} (done: {$ESTIMATES.percent}%)</td>
</tr> </tr>
{if ! $GLOBAL.website.blockexplorer.disabled} {if ! $GLOBAL.website.blockexplorer.disabled}
<tr> <tr>