From 33592eefeecd44465bb05c69b630dd3719a9a9a8 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Tue, 2 Feb 2021 12:44:27 +0100 Subject: [PATCH] return a 0 feerate if bitcoind doesn't return an estimate --- lib/bitcoind-rpc/fees.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bitcoind-rpc/fees.js b/lib/bitcoind-rpc/fees.js index 386ecd2..fb4174d 100644 --- a/lib/bitcoind-rpc/fees.js +++ b/lib/bitcoind-rpc/fees.js @@ -14,7 +14,7 @@ const latestBlock = require('./latest-block') /** - * A singleton providing information about network fees + * A singleton providing information about network fees */ class Fees { @@ -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 } })