1
0

if a network object is there but fee estimates are not available,

raise NoDynamicFeeEstimates in FeePolicy rather than in wallet.

Also, show an error message in Qt
This commit is contained in:
ThomasV
2025-03-06 12:57:05 +01:00
parent 7d8a5cc259
commit d5ee678b7f
3 changed files with 4 additions and 6 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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)