diff --git a/electrum/fee_policy.py b/electrum/fee_policy.py index 972986de9..d3c330411 100644 --- a/electrum/fee_policy.py +++ b/electrum/fee_policy.py @@ -243,13 +243,12 @@ class FeePolicy(Logger): ) -> int: if self.method == FeeMethod.FIXED: return self.value - if network is None and self.use_dynamic_estimates: + fee_per_kb = self.fee_per_kb(network) + if fee_per_kb is None and self.use_dynamic_estimates: if allow_fallback_to_static_rates: fee_per_kb = FEERATE_FALLBACK_STATIC_FEE else: raise NoDynamicFeeEstimates() - else: - fee_per_kb = self.fee_per_kb(network) return self.estimate_fee_for_feerate(fee_per_kb, size) diff --git a/electrum/gui/qt/confirm_tx_dialog.py b/electrum/gui/qt/confirm_tx_dialog.py index 1f7a5aa4d..9dee64d38 100644 --- a/electrum/gui/qt/confirm_tx_dialog.py +++ b/electrum/gui/qt/confirm_tx_dialog.py @@ -569,6 +569,8 @@ class TxEditor(WindowModalDialog): self.error = long_warning else: messages.append(long_warning) + if self.no_dynfee_estimates: + self.error = _('Fee estimates not available. Please set a fixed fee or feerate.') if self.tx.get_dummy_output(DummyAddress.SWAP): messages.append(_('This transaction will send funds to a submarine swap.')) # warn if spending unconf diff --git a/electrum/wallet.py b/electrum/wallet.py index e1875bb05..240fd031c 100644 --- a/electrum/wallet.py +++ b/electrum/wallet.py @@ -1854,9 +1854,6 @@ class Abstract_Wallet(ABC, Logger, EventListener): i_max_sum += weight i_max.append((weight, i)) - if fee_policy.method is not FeeMethod.FIXED and fee_policy.fee_per_kb(self.network) is None: - raise NoDynamicFeeEstimates() - for txin in coins: self.add_input_info(txin) nSequence = 0xffffffff - (2 if rbf else 1)