We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 785eca6 commit 1b0bb23Copy full SHA for 1b0bb23
src/daemon.rs
@@ -148,11 +148,15 @@ impl Daemon {
148
}
149
150
pub(crate) fn estimate_fee(&self, nblocks: u16) -> Result<Option<Amount>> {
151
- Ok(self
152
- .rpc
153
- .estimate_smart_fee(nblocks, None)
154
- .context("failed to estimate fee")?
155
- .fee_rate)
+ let res = self.rpc.estimate_smart_fee(nblocks, None);
+ if let Err(bitcoincore_rpc::Error::JsonRpc(jsonrpc::Error::Rpc(RpcError {
+ code: -32603,
+ ..
+ }))) = res
156
+ {
157
+ return Ok(None); // don't fail when fee estimation is disabled (e.g. with `-blocksonly=1`)
158
+ }
159
+ Ok(res.context("failed to estimate fee")?.fee_rate)
160
161
162
pub(crate) fn get_relay_fee(&self) -> Result<Amount> {
0 commit comments