feat: migrate fee discount config field for each installed coin
This commit is contained in:
parent
d6771840bd
commit
32f79bc450
3 changed files with 11 additions and 16 deletions
|
|
@ -60,18 +60,11 @@ function _balance (settings, cryptoCode) {
|
|||
function sendCoins (settings, tx) {
|
||||
return fetchWallet(settings, tx.cryptoCode)
|
||||
.then(r => {
|
||||
if (tx.cryptoCode === 'BTC') {
|
||||
return loadLatestConfig()
|
||||
.then(config => {
|
||||
const feeDiscount = config.wallets_BTC_feeDiscount
|
||||
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId, feeDiscount)
|
||||
})
|
||||
.then(res => {
|
||||
mem.clear(module.exports.balance)
|
||||
return res
|
||||
})
|
||||
}
|
||||
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId)
|
||||
return loadLatestConfig()
|
||||
.then(config => {
|
||||
const feeMultiplier = config[`wallets_${tx.cryptoCode}_feeMultiplier`]
|
||||
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId, feeMultiplier)
|
||||
})
|
||||
.then(res => {
|
||||
mem.clear(module.exports.balance)
|
||||
return res
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue