Merge pull request #1899 from MPOS/findblocks-workaround
[WORKAROUND] Blocks without confirmations
This commit is contained in:
commit
9fc1a39137
@ -58,6 +58,15 @@ if (empty($aTransactions['transactions'])) {
|
||||
$aBlockRPCInfo = $bitcoin->getblock($aData['blockhash']);
|
||||
$config['reward_type'] == 'block' ? $aData['amount'] = $aData['amount'] : $aData['amount'] = $config['reward'];
|
||||
$aData['height'] = $aBlockRPCInfo['height'];
|
||||
$aTxDetails = $bitcoin->gettransaction($aBlockRPCInfo['tx'][0]);
|
||||
if (!isset($aBlockRPCInfo['confirmations'])) {
|
||||
$aData['confirmations'] = $aBlockRPCInfo['confirmations'];
|
||||
} else if (isset($aTxDetails['confirmations'])) {
|
||||
$aData['confirmations'] = $aTxDetails['confirmations'];
|
||||
} else {
|
||||
$log->logFatal(' RPC does not return any usable block confirmation information');
|
||||
$monitoring->endCronjob($cron_name, 'E0082', 1, true);
|
||||
}
|
||||
$aData['difficulty'] = $aBlockRPCInfo['difficulty'];
|
||||
$log->logInfo(sprintf($strLogMask, substr($aData['blockhash'], 0, 17)."...", $aData['height'], $aData['amount'], $aData['confirmations'], $aData['difficulty'], strftime("%Y-%m-%d %H:%M:%S", $aData['time'])));
|
||||
if ( ! empty($aBlockRPCInfo['flags']) && preg_match('/proof-of-stake/', $aBlockRPCInfo['flags']) ) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user