[FIX] Bail findblocks on block insertion errors
Fixes #1857 once merged.
This commit is contained in:
parent
2ae2718da1
commit
aac80502e1
@ -25,7 +25,6 @@ chdir(dirname(__FILE__));
|
|||||||
// Include all settings and classes
|
// Include all settings and classes
|
||||||
require_once('shared.inc.php');
|
require_once('shared.inc.php');
|
||||||
|
|
||||||
|
|
||||||
// Fetch our last block found from the DB as a starting point
|
// Fetch our last block found from the DB as a starting point
|
||||||
$aLastBlock = @$block->getLast();
|
$aLastBlock = @$block->getLast();
|
||||||
$strLastBlockHash = $aLastBlock['blockhash'];
|
$strLastBlockHash = $aLastBlock['blockhash'];
|
||||||
@ -66,7 +65,8 @@ if (empty($aTransactions['transactions'])) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!$block->addBlock($aData) ) {
|
if (!$block->addBlock($aData) ) {
|
||||||
$log->logFatal('Unable to add block: ' . $aData['height'] . ': ' . $block->getCronError());
|
$log->logFatal('Unable to add block: (' . $aData['height'] . ') ' . $aData['blockhash'] . ': ' . $block->getCronError());
|
||||||
|
$monitoring->endCronjob($cron_name, 'E0081', 1, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,4 +76,5 @@ $aErrorCodes['E0077'] = 'RPC method or connection failed';
|
|||||||
$aErrorCodes['E0078'] = 'RPC method did not return 200 OK';
|
$aErrorCodes['E0078'] = 'RPC method did not return 200 OK';
|
||||||
$aErrorCodes['E0079'] = 'Wallet does not cover payouts total amount';
|
$aErrorCodes['E0079'] = 'Wallet does not cover payouts total amount';
|
||||||
$aErrorCodes['E0080'] = 'No new unaccounted shares since last run';
|
$aErrorCodes['E0080'] = 'No new unaccounted shares since last run';
|
||||||
|
$aErrorCodes['E0081'] = 'Failed to insert new block into database';
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user