fix: remove unnecessary config load and fee calculation
This commit is contained in:
parent
8c948d08c7
commit
c200b0824a
2 changed files with 3 additions and 6 deletions
|
|
@ -60,7 +60,7 @@ function estimateFee () {
|
||||||
function calculateFeeDiscount (feeMultiplier) {
|
function calculateFeeDiscount (feeMultiplier) {
|
||||||
// 0 makes bitcoind do automatic fee selection
|
// 0 makes bitcoind do automatic fee selection
|
||||||
const AUTOMATIC_FEE = 0
|
const AUTOMATIC_FEE = 0
|
||||||
if (!feeMultiplier) return AUTOMATIC_FEE
|
if (!feeMultiplier || feeMultiplier.eq(1)) return AUTOMATIC_FEE
|
||||||
return estimateFee()
|
return estimateFee()
|
||||||
.then(estimatedFee => {
|
.then(estimatedFee => {
|
||||||
if (!estimatedFee) return AUTOMATIC_FEE
|
if (!estimatedFee) return AUTOMATIC_FEE
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,8 @@ function _balance (settings, cryptoCode) {
|
||||||
function sendCoins (settings, tx) {
|
function sendCoins (settings, tx) {
|
||||||
return fetchWallet(settings, tx.cryptoCode)
|
return fetchWallet(settings, tx.cryptoCode)
|
||||||
.then(r => {
|
.then(r => {
|
||||||
return loadLatestConfig()
|
const feeMultiplier = settings[`wallets_${tx.cryptoCode}_feeMultiplier`]
|
||||||
.then(config => {
|
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId, feeMultiplier)
|
||||||
const feeMultiplier = config[`wallets_${tx.cryptoCode}_feeMultiplier`]
|
|
||||||
return r.wallet.sendCoins(r.account, tx, settings, r.operatorId, feeMultiplier)
|
|
||||||
})
|
|
||||||
.then(res => {
|
.then(res => {
|
||||||
mem.clear(module.exports.balance)
|
mem.clear(module.exports.balance)
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue