diff --git a/cronjobs/pplns_payout.php b/cronjobs/pplns_payout.php index ece9cb4d..11841bb3 100755 --- a/cronjobs/pplns_payout.php +++ b/cronjobs/pplns_payout.php @@ -209,15 +209,15 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { // Move counted shares to archive before this blockhash upstream share if (!$share->moveArchive($iCurrentUpstreamId, $aBlock['id'], $iPreviousShareId)) - $log->logError('Failed to copy shares to archive table'); + $log->logError('Failed to copy shares to archive table: ' . $share->getError()); // Delete all accounted shares if (!$share->deleteAccountedShares($iCurrentUpstreamId, $iPreviousShareId)) { - $log->logFatal("Failed to delete accounted shares from $iPreviousShareId to $iCurrentUpstreamId, aborting!"); + $log->logFatal("Failed to delete accounted shares from $iPreviousShareId to $iCurrentUpstreamId, aborting! Error: " . $share->getError()); $monitoring->endCronjob($cron_name, 'E0016', 1, true); } // Mark this block as accounted for if (!$block->setAccounted($aBlock['id'])) { - $log->logFatal("Failed to mark block as accounted! Aborting!"); + $log->logFatal("Failed to mark block as accounted! Aborting! Error: " . $block->getError()); $monitoring->endCronjob($cron_name, 'E0014', 1, true); } } else { diff --git a/cronjobs/pps_payout.php b/cronjobs/pps_payout.php index 91fdcddc..468a4694 100755 --- a/cronjobs/pps_payout.php +++ b/cronjobs/pps_payout.php @@ -146,23 +146,17 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { // Move shares to archive if ($aBlock['share_id'] < $iLastShareId) { if (!$share->moveArchive($aBlock['share_id'], $aBlock['id'], @$iLastBlockShare)) - $log->logError("Archving failed"); + $log->logError("Failed to copy shares to archive: " . $share->getError()); } // Delete shares if ($aBlock['share_id'] < $iLastShareId && !$share->deleteAccountedShares($aBlock['share_id'], $iLastBlockShare)) { - $log->logFatal("Failed to delete accounted shares from " . $aBlock['share_id'] . " to " . $iLastBlockShare . ", aborting!"); - $monitoring->setStatus($cron_name . "_active", "yesno", 0); - $monitoring->setStatus($cron_name . "_message", "message", "Failed to delete accounted shares from " . $aBlock['share_id'] . " to " . $iLastBlockShare); - $monitoring->setStatus($cron_name . "_status", "okerror", 1); - exit(1); + $log->logFatal("Failed to delete accounted shares from " . $aBlock['share_id'] . " to " . $iLastBlockShare . ", aborting! Error: " . $share->getError()); + $monitoring->endCronjob($cron_name, 'E0016', 1, true); } // Mark this block as accounted for if (!$block->setAccounted($aBlock['id'])) { - $log->logFatal("Failed to mark block as accounted! Aborting!"); - $monitoring->setStatus($cron_name . "_active", "yesno", 0); - $monitoring->setStatus($cron_name . "_message", "message", "Failed to mark block " . $aBlock['height'] . " as accounted"); - $monitoring->setStatus($cron_name . "_status", "okerror", 1); - exit(1); + $log->logFatal("Failed to mark block as accounted! Aborting! Error: " . $block->getError()); + $monitoring->endCronjob($cron_name, 'E0014', 1, true); } } diff --git a/cronjobs/proportional_payout.php b/cronjobs/proportional_payout.php index f9a6bba6..0fb78090 100755 --- a/cronjobs/proportional_payout.php +++ b/cronjobs/proportional_payout.php @@ -105,15 +105,15 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { // Move counted shares to archive before this blockhash upstream share if (!$share->moveArchive($iCurrentUpstreamId, $aBlock['id'], $iPreviousShareId)) - $log->logError('Failed to copy shares to archive'); + $log->logError('Failed to copy shares to archive: ' . $share->getError()); // Delete all accounted shares if (!$share->deleteAccountedShares($iCurrentUpstreamId, $iPreviousShareId)) { - $log->logFatal('Failed to delete accounted shares from ' . $iPreviousShareId . ' to ' . $iCurrentUpstreamId . ', aborted'); + $log->logFatal('Failed to delete accounted shares from ' . $iPreviousShareId . ' to ' . $iCurrentUpstreamId . ', aborted! Error: ' . $share->getError()); $monitoring->endCronjob($cron_name, 'E0016', 1, true); } // Mark this block as accounted for if (!$block->setAccounted($aBlock['id'])) { - $log->logFatal('Failed to mark block as accounted! Aborted.'); + $log->logFatal('Failed to mark block as accounted! Aborted! Error: ' . $block->getError()); $monitoring->endCronjob($cron_name, 'E0014', 1, true); } } else { diff --git a/public/include/classes/share.class.php b/public/include/classes/share.class.php index 592e1851..adaae9bf 100644 --- a/public/include/classes/share.class.php +++ b/public/include/classes/share.class.php @@ -228,6 +228,7 @@ class Share Extends Base { return true; } // Catchall + $this->setErrorMessage('Archiving shares failed: ' . $this->mysqli->error); return false; } @@ -236,6 +237,7 @@ class Share Extends Base { if ($this->checkStmt($stmt) && $stmt->bind_param('ii', $previous_upstream, $current_upstream) && $stmt->execute()) return true; // Catchall + $this->setErrorMessage('Deleting shares failed: ' . $this->mysqli->error); return false; } /**