mirror of
https://github.com/jwinterm/node-tip-bot.git
synced 2026-10-17 05:41:42 +02:00
proper collection of fees
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -14,6 +14,7 @@ development:
|
||||
port: 22555
|
||||
user: 'dogecoinrpc'
|
||||
pass: 'pass'
|
||||
master_account: unek
|
||||
coin:
|
||||
withdrawal_fee: 2
|
||||
min_withdraw: 5
|
||||
|
||||
Reference in New Issue
Block a user