fix payment redis final cleanout issue - possible double spending - optimized - fixed
This commit is contained in:
parent
1f15c418c8
commit
a9132319cc
|
@ -470,27 +470,24 @@ function SetupForPool(logger, poolOptions, setupFinished){
|
||||||
if (orphanMergeCommands.length > 0)
|
if (orphanMergeCommands.length > 0)
|
||||||
finalRedisCommands = finalRedisCommands.concat(orphanMergeCommands);
|
finalRedisCommands = finalRedisCommands.concat(orphanMergeCommands);
|
||||||
|
|
||||||
|
|
||||||
if (balanceUpdateCommands.length > 0)
|
if (balanceUpdateCommands.length > 0)
|
||||||
finalRedisCommands = finalRedisCommands.concat(balanceUpdateCommands);
|
finalRedisCommands = finalRedisCommands.concat(balanceUpdateCommands);
|
||||||
|
|
||||||
|
|
||||||
if (workerPayoutsCommand.length > 0)
|
if (workerPayoutsCommand.length > 0)
|
||||||
finalRedisCommands = finalRedisCommands.concat(workerPayoutsCommand);
|
finalRedisCommands = finalRedisCommands.concat(workerPayoutsCommand);
|
||||||
|
|
||||||
|
|
||||||
if (roundsToDelete.length > 0)
|
if (roundsToDelete.length > 0)
|
||||||
finalRedisCommands.push(['del'].concat(roundsToDelete));
|
finalRedisCommands.push(['del'].concat(roundsToDelete));
|
||||||
|
|
||||||
|
|
||||||
if (toBePaid !== 0)
|
if (toBePaid !== 0)
|
||||||
finalRedisCommands.push(['hincrbyfloat', coin + '_stats', 'totalPaid', (toBePaid / magnitude).toFixed(coinPrecision)]);
|
finalRedisCommands.push(['hincrbyfloat', coin + '_stats', 'totalPaid', (toBePaid / magnitude).toFixed(coinPrecision)]);
|
||||||
|
|
||||||
|
finalRedisCommands.push(['del', coin + '_finalRedisCommands']);
|
||||||
|
|
||||||
finalRedisCommands.push(['bgsave']);
|
finalRedisCommands.push(['bgsave']);
|
||||||
|
|
||||||
callback(null, magnitude, workerPayments, finalRedisCommands);
|
callback(null, magnitude, workerPayments, finalRedisCommands);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue