[Improved] Logic
This commit is contained in:
parent
d278e99172
commit
c91bb682af
@ -148,16 +148,9 @@ if (!$setting->setValue('pps_last_share_id', $iLastShareId)) {
|
|||||||
|
|
||||||
// Fetch all unaccounted blocks
|
// Fetch all unaccounted blocks
|
||||||
$log->logInfo("\tFetching unaccounted blocks.");
|
$log->logInfo("\tFetching unaccounted blocks.");
|
||||||
if (!$aAllBlocks = $block->getAllUnaccounted('ASC')) {
|
if ($aAllBlocks = $block->getAllUnaccounted('ASC')) {
|
||||||
$log->logInfo("Failed to fetch unaccounted Blocks. NOTICE: " . $block->getCronError());
|
// Go through blocks and archive/delete shares that have been accounted for
|
||||||
}
|
foreach ($aAllBlocks as $iIndex => $aBlock) {
|
||||||
if (empty($aAllBlocks)) {
|
|
||||||
$log->logInfo("\tNo new blocks.");
|
|
||||||
// No monitoring event here, not fatal for PPS
|
|
||||||
}
|
|
||||||
|
|
||||||
// Go through blocks and archive/delete shares that have been accounted for
|
|
||||||
foreach ($aAllBlocks as $iIndex => $aBlock) {
|
|
||||||
// If we are running through more than one block, check for previous share ID
|
// If we are running through more than one block, check for previous share ID
|
||||||
$log->logInfo("\tProcess each block for Previous Share ID.");
|
$log->logInfo("\tProcess each block for Previous Share ID.");
|
||||||
$iLastBlockShare = @$aAllBlocks[$iIndex - 1]['share_id'] ? @$aAllBlocks[$iIndex - 1]['share_id'] : 0;
|
$iLastBlockShare = @$aAllBlocks[$iIndex - 1]['share_id'] ? @$aAllBlocks[$iIndex - 1]['share_id'] : 0;
|
||||||
@ -202,6 +195,14 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
|||||||
$monitoring->endCronjob($cron_name, 'E0014', 1, true);
|
$monitoring->endCronjob($cron_name, 'E0014', 1, true);
|
||||||
}
|
}
|
||||||
$log->logInfo("\t$aBlock['id']\t Block paid and accounted for.");
|
$log->logInfo("\t$aBlock['id']\t Block paid and accounted for.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (empty($aAllBlocks)) {
|
||||||
|
$log->logInfo("\tNo new blocks.");
|
||||||
|
// No monitoring event here, not fatal for PPS
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$log->logInfo("Failed to fetch unaccounted Blocks. NOTICE: " . $block->getCronError());
|
||||||
}
|
}
|
||||||
$log->logInfo("Completed PPS Payout");
|
$log->logInfo("Completed PPS Payout");
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user