proper collection of fees

This commit is contained in:
unek
2014-02-22 12:48:48 +01:00
parent c50852c54d
commit 09fcbd6ee5
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -231,6 +231,22 @@ client.addListener('message', function(from, channel, message) {
client.say(channel, settings.messages.withdraw_success.expand({name: from, address: address, balance: balance, amount: balance - settings.coin.withdrawal_fee, transaction: reply}));
client.say(channel, settings.messages.withdraw_success2.expand({name: from, address: address, balance: balance, amount: balance - settings.coin.withdrawal_fee, transaction: reply}));
// transfer the rest (usually withdrawal fee - txfee) to the master account
coin.getBalance(from.toLowerCase(), function(err, balance) {
if(err) {
winston.error('Something went wrong while transferring fees', err);
return;
}
var balance = typeof(balance) == 'object' ? balance.result : balance;
coin.move(from.toLowerCase(), settings.rpc.master_account, balance, function(err) {
if(err) {
winston.error('Something went wrong while transferring fees', err);
return;
}
});
}
});
});
} else {
+1
View File
@@ -14,6 +14,7 @@ development:
port: 22555
user: 'dogecoinrpc'
pass: 'pass'
master_account: unek
coin:
withdrawal_fee: 2
min_withdraw: 5