Skip to content

Commit

Permalink
Remove miner pay fee for interim until working better
Browse files Browse the repository at this point in the history
  • Loading branch information
2acoin committed Jan 7, 2021
1 parent f579767 commit b083cd3
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions lib/paymentProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,35 +192,9 @@ function runInterval(){
};
}

workerTXFee = 0;
if(config.payments.minerPayFee){
if (config.wallet.api) {
prepBasic = {
destination: address,
amount: amount
};
apiInterfaces.rpcWallet('/transactions/prepare/basic', prepBasic, function(error, result){
if (error){
log('error', logSystem, 'Error with transPrep request to wallet daemon %j', ['prepBasic']);
} else {
log('info', logSystem, 'Miner %j pays fee of %s', [prepBasic, result.fee]);
workerTXFee = result.fee;
amount -= result.fee;
}
});
} else {
// we want the miner to pay a static fee not dynamically calculated without wallet-api
workerTXFee = config.payments.transferFee;
amount -= config.payments.transferFee;
}
}

transferCommands[commandIndex].rpc.destinations.push({amount: amount, address: address});
transferCommands[commandIndex].redis.push(['hincrby', config.coin + ':workers:' + worker, 'paid', amount]);
transferCommands[commandIndex].redis.push(['hincrby', config.coin + ':workers:' + worker, 'balance', -amount]);
if (workerTXFee > 0) {
transferCommands[commandIndex].redis.push(['hincrby', config.coin + ':workers:' + worker, 'balance', -workerTXFee]);
}
transferCommands[commandIndex].amount += amount;
if (payment_id) transferCommands[commandIndex].rpc.payment_id = payment_id;

Expand Down

0 comments on commit b083cd3

Please sign in to comment.