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:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user