From a9132319cc1c573882c819c31e5749d71ae7b0c4 Mon Sep 17 00:00:00 2001 From: "Eugene@ubuntu" Date: Thu, 3 Apr 2014 00:43:58 +0400 Subject: [PATCH] fix payment redis final cleanout issue - possible double spending - optimized - fixed --- libs/paymentProcessor.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libs/paymentProcessor.js b/libs/paymentProcessor.js index 3f1f2cb..91bfeb4 100644 --- a/libs/paymentProcessor.js +++ b/libs/paymentProcessor.js @@ -470,27 +470,24 @@ function SetupForPool(logger, poolOptions, setupFinished){ if (orphanMergeCommands.length > 0) finalRedisCommands = finalRedisCommands.concat(orphanMergeCommands); - if (balanceUpdateCommands.length > 0) finalRedisCommands = finalRedisCommands.concat(balanceUpdateCommands); - if (workerPayoutsCommand.length > 0) finalRedisCommands = finalRedisCommands.concat(workerPayoutsCommand); - if (roundsToDelete.length > 0) finalRedisCommands.push(['del'].concat(roundsToDelete)); - if (toBePaid !== 0) finalRedisCommands.push(['hincrbyfloat', coin + '_stats', 'totalPaid', (toBePaid / magnitude).toFixed(coinPrecision)]); + finalRedisCommands.push(['del', coin + '_finalRedisCommands']); + finalRedisCommands.push(['bgsave']); callback(null, magnitude, workerPayments, finalRedisCommands); - }); },