1
0

Qt pay_lightning_invoice: handle NoDynamicFeeEstimates

`wallet.make_unsigned_transaction` can raise NotEnoughFunds or NoDynamicFeeEstimates.
These are "expected" exceptions that need to be handled or worked around. Added a note
of this in the docstring now.

We now handle NoDynamicFeeEstimates by allowing a static fallback fee in
`wallet.can_pay_onchain` and `lnworker.suggest_funding_amount`. It should be
fine to have a static fallback in these cases, as the user still has a chance
to set their own fee later in the flow.
(though ofc the static fallback might be too high in some mempool conditions,
in which case e.g. can_pay_onchain might return a false-negative, but this
is still an improvement over raising I believe)

fixes https://github.com/spesmilo/electrum/issues/5784
This commit is contained in:
SomberNight
2022-08-30 11:46:52 +00:00
parent a143d05fb9
commit 42f2a3da31
3 changed files with 7 additions and 4 deletions

View File

@@ -686,7 +686,7 @@ class SendTab(QWidget, MessageBoxMixin, Logger):
choices[3] = msg
msg = _('You cannot pay that invoice using Lightning.')
if self.wallet.lnworker.channels:
msg += '\n' + _('Your channels can send {}.').format(self.format_amount(num_sats_can_send) + self.base_unit())
msg += '\n' + _('Your channels can send {}.').format(self.format_amount(num_sats_can_send) + ' ' + self.base_unit())
if not choices:
self.window.show_error(msg)
return