From 21acec83d0d30aa5f3c09b3ff11cc7a7558b22f8 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sun, 17 Nov 2013 16:36:30 +0100 Subject: [PATCH] [FIX] Proper error on missing shares --- cronjobs/findblock.php | 5 +++++ public/include/classes/share.class.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cronjobs/findblock.php b/cronjobs/findblock.php index 8e12a5d9..782ed92a 100755 --- a/cronjobs/findblock.php +++ b/cronjobs/findblock.php @@ -86,6 +86,11 @@ if (empty($aAllBlocks)) { $aBlockRPCInfo = $bitcoin->query('getblock', $aBlock['blockhash']); if ($share->findUpstreamShare($aBlockRPCInfo, $iPreviousShareId)) { $iCurrentUpstreamId = $share->getUpstreamShareId(); + // Rarely happens, but did happen once to me + if ($iCurrentUpstreamId == $iPreviousShareId) { + $log->logFatal($share->getErrorMsg('E0063')); + $monitoring->endCronjob($cron_name, 'E0063', 1, true); + } // Out of order share detection if ($iCurrentUpstreamId < $iPreviousShareId) { // Fetch our offending block diff --git a/public/include/classes/share.class.php b/public/include/classes/share.class.php index cc634269..bbf378cf 100644 --- a/public/include/classes/share.class.php +++ b/public/include/classes/share.class.php @@ -315,7 +315,8 @@ class Share Extends Base { if (!empty($this->oUpstream->account) && is_int($this->oUpstream->id)) return true; } - return $this->getErrorMsg('E0052', $aBlock['height']); + $this->setErrorMessage($this->getErrorMsg('E0052', $aBlock['height'])); + return false; } /**