1
0

Fallback addresses

- add fallback address to BOLT-11 LN invoices
   - Qt: if LN payment fails, propose onchain fallback
This commit is contained in:
ThomasV
2022-03-29 10:36:36 +02:00
parent f18a042955
commit 2c6e36e89d
2 changed files with 11 additions and 3 deletions

View File

@@ -1698,7 +1698,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
def on_payment_failed(self, wallet, key, reason):
invoice = self.wallet.get_invoice(key)
self.show_error(_('Payment failed') + '\n\n' + reason)
if invoice and invoice.is_lightning() and invoice.get_address():
if self.question(_('Payment failed') + '\n\n' + reason + '\n\n'+ 'Fallback to onchain payment?'):
self.pay_onchain_dialog(self.get_coins(), invoice.get_outputs())
else:
self.show_error(_('Payment failed') + '\n\n' + reason)
def read_invoice(self):
if self.check_send_tab_payto_line_and_show_errors():