diff --git a/config_example.json b/config_example.json index 88e4a8b..0dc267f 100644 --- a/config_example.json +++ b/config_example.json @@ -25,8 +25,7 @@ }, "redis": { "host": "127.0.0.1", - "port": 6379, - "keepRounds": false + "port": 6379 } }, diff --git a/libs/paymentProcessor.js b/libs/paymentProcessor.js index 78e5659..0d9c392 100644 --- a/libs/paymentProcessor.js +++ b/libs/paymentProcessor.js @@ -10,7 +10,6 @@ var util = require('stratum-pool/lib/util.js'); module.exports = function(logger){ var poolConfigs = JSON.parse(process.env.pools); - var portalConfig = JSON.parse(process.env.portalConfig); var enabledPools = []; @@ -165,7 +164,7 @@ function SetupForPool(logger, poolOptions, setupFinished){ else { var tBalance = 0; for (var i = 0, len = result[0].response.length; i < len; i++) { - tBalance = tBalance + Number((result[0].response[i].amount * magnitude)); + tBalance = Number(tBalance + (result[0].response[i].amount * 100000000)).toFixed(0); } logger.debug(logSystem, logComponent, addr + ' contains a balance of: ' + (tBalance / magnitude)); callback(null, tBalance); @@ -510,7 +509,7 @@ function SetupForPool(logger, poolOptions, setupFinished){ return; } - daemon.cmd('sendmany', [addressAccount, addressAmounts], function (result) { + daemon.cmd('sendmany', [addressAccount || '', addressAmounts], function (result) { //Check if payments failed because wallet doesn't have enough coins to pay for tx fees if (result.error && result.error.code === -6) { var higherPercent = withholdPercent + 0.01; @@ -589,11 +588,7 @@ function SetupForPool(logger, poolOptions, setupFinished){ return; case 'generate': movePendingCommands.push(['smove', coin + ':blocksPending', coin + ':blocksConfirmed', r.serialized]); - if (portalConfig.defaultPoolConfigs.redis.keepRounds) { - //Do nothing - } else { - roundsToDelete.push(coin + ':shares:round' + r.height); - } + roundsToDelete.push(coin + ':shares:round' + r.height); return; }