Browse Source

Merge branch 'fix_dojo_fees_api' into 'develop'

return a 0 feerate if bitcoind doesn't return an estimate

See merge request dojo/samourai-dojo!189
develop
kenshin-samourai 4 years ago
parent
commit
a93164e5dd
  1. 4
      lib/bitcoind-rpc/fees.js

4
lib/bitcoind-rpc/fees.js

@ -56,10 +56,10 @@ class Fees {
await util.seriesCall(this.targets, async tgt => {
try {
const level = await this.rpcClient.cmd('estimatesmartfee', tgt, this.feeType)
this.fees[tgt] = Math.round(level.feerate * 1e5)
this.fees[tgt] = (level.errors && level.errors.length > 0) ? 0 : Math.round(level.feerate * 1e5)
} catch(e) {
Logger.error(e, 'Bitcoind RPC : Fees.refresh()')
delete this.fees[tgt]
this.fees[tgt] = 0
}
})

Loading…
Cancel
Save