diff --git a/cronjobs/pplns_payout.php b/cronjobs/pplns_payout.php index d95af481..39ea294a 100755 --- a/cronjobs/pplns_payout.php +++ b/cronjobs/pplns_payout.php @@ -175,6 +175,9 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { $log->logFatal('Failed to insert new Donation transaction to database for ' . $aData['username']); } + // Store this blocks height as last accounted for + $setting->setValue('last_accounted_block_height', $aBlock['height']); + // 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'); @@ -183,8 +186,6 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { $log->logFatal("Failed to delete accounted shares from $iPreviousShareId to $iCurrentUpstreamId, aborting!"); exit(1); } - // Store this blocks height as last accounted for - $setting->setValue('last_accounted_block_height', $aBlock['height']); // Mark this block as accounted for if (!$block->setAccounted($aBlock['id'])) { $log->logFatal("Failed to mark block as accounted! Aborting!"); diff --git a/cronjobs/proportional_payout.php b/cronjobs/proportional_payout.php index 31a24beb..6ce29c15 100755 --- a/cronjobs/proportional_payout.php +++ b/cronjobs/proportional_payout.php @@ -100,6 +100,9 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { $log->logFatal('Failed to insert new Donation transaction to database for ' . $aData['username']); } + // Add block as accounted for into settings table + $setting->setValue('last_accounted_block_height', $aBlock['height']); + // 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'); @@ -111,8 +114,6 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { $monitoring->setStatus($cron_name . "_status", "okerror", 1); exit(1); } - // Add block as accounted for into settings table - $setting->setValue('last_accounted_block_height', $aBlock['height']); // Mark this block as accounted for if (!$block->setAccounted($aBlock['id'])) { $log->logFatal('Failed to mark block as accounted! Aborted.');