Browse Source

fix ln payments: set payto_e ln invoice correctly

payto_e.lightning_invoice has to be set after the payment field is set
to the node pub key, because check_text has the side effect of resetting
the payto_e.lightning_invoice
patch-4
bitromortac 3 years ago
parent
commit
ebc5954d61
No known key found for this signature in database GPG Key ID: 1965063FC13BEBE2
  1. 2
      electrum/gui/qt/main_window.py

2
electrum/gui/qt/main_window.py

@ -1970,7 +1970,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
self.show_error(_("Error parsing Lightning invoice") + f":\n{e}")
return
self.payto_e.lightning_invoice = invoice
pubkey = bh2u(lnaddr.pubkey.serialize())
for k,v in lnaddr.tags:
if k == 'd':
@ -1980,6 +1979,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
description = ''
self.payto_e.setFrozen(True)
self.payto_e.setText(pubkey)
self.payto_e.lightning_invoice = invoice
self.message_e.setText(description)
if lnaddr.get_amount_sat() is not None:
self.amount_e.setAmount(lnaddr.get_amount_sat())

Loading…
Cancel
Save