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
|
// Fetch data from wallet
|
||||||
if ($bitcoin->can_connect() === true){
|
if ($bitcoin->can_connect() === true){
|
||||||
if (!$dDifficulty = $memcache->get('dDifficulty')) {
|
$dDifficulty = $bitcoin->getdifficulty();
|
||||||
$dDifficulty = $bitcoin->query('getdifficulty');
|
|
||||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
|
||||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
|
||||||
$memcache->set('dDifficulty', $dDifficulty);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$iDifficulty = 1;
|
$iDifficulty = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,8 +19,6 @@ $aShares['valid'] > 0 ? $dEfficiency = round((100 - (100 / $aShares['valid'] * $
|
|||||||
// Fetch RPC data
|
// Fetch RPC data
|
||||||
if ($bitcoin->can_connect() === true){
|
if ($bitcoin->can_connect() === true){
|
||||||
$dDifficulty = $bitcoin->getdifficulty();
|
$dDifficulty = $bitcoin->getdifficulty();
|
||||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
|
||||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
|
||||||
$iBlock = $bitcoin->getblockcount();
|
$iBlock = $bitcoin->getblockcount();
|
||||||
} else {
|
} else {
|
||||||
$dDifficulty = 1;
|
$dDifficulty = 1;
|
||||||
|
|||||||
@ -7,9 +7,7 @@ if (!defined('SECURITY'))
|
|||||||
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
||||||
$debug->append('No cached version available, fetching from backend', 3);
|
$debug->append('No cached version available, fetching from backend', 3);
|
||||||
if ($bitcoin->can_connect() === true){
|
if ($bitcoin->can_connect() === true){
|
||||||
$dDifficulty = $bitcoin->query('getdifficulty');
|
$dDifficulty = $bitcoin->getdifficulty();
|
||||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
|
||||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
|
||||||
$iBlock = $bitcoin->query('getblockcount');
|
$iBlock = $bitcoin->query('getblockcount');
|
||||||
} else {
|
} else {
|
||||||
$dDifficulty = 1;
|
$dDifficulty = 1;
|
||||||
|
|||||||
@ -8,8 +8,6 @@ if (!$smarty->isCached('master.tpl', $smarty_cache_key)) {
|
|||||||
// Fetch data from wallet
|
// Fetch data from wallet
|
||||||
if ($bitcoin->can_connect() === true){
|
if ($bitcoin->can_connect() === true){
|
||||||
$dDifficulty = $bitcoin->getdifficulty();
|
$dDifficulty = $bitcoin->getdifficulty();
|
||||||
if (is_array($dDifficulty) && array_key_exists('proof-of-work', $dDifficulty))
|
|
||||||
$dDifficulty = $dDifficulty['proof-of-work'];
|
|
||||||
$iBlock = $bitcoin->getblockcount();
|
$iBlock = $bitcoin->getblockcount();
|
||||||
is_int($iBlock) && $iBlock > 0 ? $sBlockHash = $bitcoin->query('getblockhash', $iBlock) : $sBlockHash = '';
|
is_int($iBlock) && $iBlock > 0 ? $sBlockHash = $bitcoin->query('getblockhash', $iBlock) : $sBlockHash = '';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user