From b98258bf623de8d0c26bf9af632897c4790ccd63 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Wed, 30 Oct 2013 14:45:40 +0100 Subject: [PATCH] [FIX] Fix payouts on orphans --- cronjobs/pplns_payout.php | 2 +- cronjobs/proportional_payout.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cronjobs/pplns_payout.php b/cronjobs/pplns_payout.php index 4d15d444..eabbe77c 100755 --- a/cronjobs/pplns_payout.php +++ b/cronjobs/pplns_payout.php @@ -59,7 +59,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { $iLastBlockHeight = 0; } // Double payout detection - if (!$aBlock['accounted'] && $aBlock['height'] > $iLastBlockHeight && @$aLastAccountedBlock['confirmations'] != -1) { + if ( ( !$aBlock['accounted'] && $aBlock['height'] > $iLastBlockHeight ) || @$aLastAccountedBlock['confirmations'] == -1) { $iPreviousShareId = @$aAllBlocks[$iIndex - 1]['share_id'] ? $aAllBlocks[$iIndex - 1]['share_id'] : 0; $iCurrentUpstreamId = $aBlock['share_id']; if (!is_numeric($iCurrentUpstreamId)) { diff --git a/cronjobs/proportional_payout.php b/cronjobs/proportional_payout.php index 0d34ed39..b6b8dac0 100755 --- a/cronjobs/proportional_payout.php +++ b/cronjobs/proportional_payout.php @@ -50,7 +50,8 @@ foreach ($aAllBlocks as $iIndex => $aBlock) { } else { $iLastBlockHeight = 0; } - if (!$aBlock['accounted'] && $aBlock['height'] > $iLastBlockHeight && @$aLastAccountedBlock['confirmations'] != -1) { + // Double payout detection + if ( ( !$aBlock['accounted'] && $aBlock['height'] > $iLastBlockHeight ) || @$aLastAccountedBlock['confirmations'] == -1) { $iPreviousShareId = @$aAllBlocks[$iIndex - 1]['share_id'] ? $aAllBlocks[$iIndex - 1]['share_id'] : 0; $iCurrentUpstreamId = $aBlock['share_id']; $aAccountShares = $share->getSharesForAccounts($iPreviousShareId, $aBlock['share_id']);