Display network hashrate in public API
Instead of 0 show the actual hashrate, still shows 0 if unable to connect to RPC server. Fixes #511
This commit is contained in:
parent
6a04666ec3
commit
c7f952a27a
@ -10,6 +10,9 @@ $api->isActive();
|
|||||||
$aLastBlock = $block->getLast();
|
$aLastBlock = $block->getLast();
|
||||||
$aShares = $statistics->getRoundShares();
|
$aShares = $statistics->getRoundShares();
|
||||||
|
|
||||||
|
// RPC Calls
|
||||||
|
$bitcoin->can_connect() === true ? $dNetworkHashrate = $bitcoin->query('getnetworkhashps') : $dNetworkHashrate = 0;
|
||||||
|
|
||||||
echo json_encode(
|
echo json_encode(
|
||||||
array(
|
array(
|
||||||
'pool_name' => $config['website']['name'],
|
'pool_name' => $config['website']['name'],
|
||||||
@ -17,7 +20,7 @@ echo json_encode(
|
|||||||
'workers' => $worker->getCountAllActiveWorkers(),
|
'workers' => $worker->getCountAllActiveWorkers(),
|
||||||
'shares_this_round' => $aShares['valid'],
|
'shares_this_round' => $aShares['valid'],
|
||||||
'last_block' => $aLastBlock['height'],
|
'last_block' => $aLastBlock['height'],
|
||||||
'network_hashrate' => '0'
|
'network_hashrate' => $dNetworkHashrate
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user