use bitcoin wrapper method for getdiff calls
This commit is contained in:
parent
af21cafea5
commit
baaf743218
@ -11,12 +11,7 @@ $id = $user->checkApiKey($_REQUEST['api_key']);
|
||||
|
||||
// Fetch data from wallet
|
||||
if ($bitcoin->can_connect() === true){
|
||||
if (!$dDifficulty = $memcache->get('dDifficulty')) {
|
||||
$dDifficulty = $bitcoin->query('getdifficulty');
|
||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||
$memcache->set('dDifficulty', $dDifficulty);
|
||||
}
|
||||
$dDifficulty = $bitcoin->getdifficulty();
|
||||
} else {
|
||||
$iDifficulty = 1;
|
||||
}
|
||||
|
||||
@ -19,8 +19,6 @@ $aShares['valid'] > 0 ? $dEfficiency = round((100 - (100 / $aShares['valid'] * $
|
||||
// Fetch RPC data
|
||||
if ($bitcoin->can_connect() === true){
|
||||
$dDifficulty = $bitcoin->getdifficulty();
|
||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||
$iBlock = $bitcoin->getblockcount();
|
||||
} else {
|
||||
$dDifficulty = 1;
|
||||
|
||||
@ -7,9 +7,7 @@ if (!defined('SECURITY'))
|
||||
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
$debug->append('No cached version available, fetching from backend', 3);
|
||||
if ($bitcoin->can_connect() === true){
|
||||
$dDifficulty = $bitcoin->query('getdifficulty');
|
||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||
$dDifficulty = $bitcoin->getdifficulty();
|
||||
$iBlock = $bitcoin->query('getblockcount');
|
||||
} else {
|
||||
$dDifficulty = 1;
|
||||
|
||||
@ -8,8 +8,6 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||
// Fetch data from wallet
|
||||
if ($bitcoin->can_connect() === true){
|
||||
$dDifficulty = $bitcoin->getdifficulty();
|
||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
||||
$iBlock = $bitcoin->getblockcount();
|
||||
is_int($iBlock) && $iBlock > 0 ? $sBlockHash = $bitcoin->query('getblockhash', $iBlock) : $sBlockHash = '';
|
||||
} else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user