[FIX] Bail findblocks on block insertion errors

Fixes #1857 once merged.
This commit is contained in:
Sebastian Grewe 2014-02-28 09:09:29 +01:00
parent 2ae2718da1
commit aac80502e1
2 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,6 @@ chdir(dirname(__FILE__));
// Include all settings and classes
require_once('shared.inc.php');
// Fetch our last block found from the DB as a starting point
$aLastBlock = @$block->getLast();
$strLastBlockHash = $aLastBlock['blockhash'];
@ -66,7 +65,8 @@ if (empty($aTransactions['transactions'])) {
continue;
}
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);
}
}
}

View File

@ -76,4 +76,5 @@ $aErrorCodes['E0077'] = 'RPC method or connection failed';
$aErrorCodes['E0078'] = 'RPC method did not return 200 OK';
$aErrorCodes['E0079'] = 'Wallet does not cover payouts total amount';
$aErrorCodes['E0080'] = 'No new unaccounted shares since last run';
$aErrorCodes['E0081'] = 'Failed to insert new block into database';
?>