lnaddr: clean-up SEGWIT_HRP vs BOLT11_HRP confusion
With signet, SEGWIT_HRP != BOLT11_HRP, so the previous "currency" string became a flawed concept. Instead we pass around net objects now.
This commit is contained in:
@@ -187,7 +187,7 @@ class SendScreen(CScreen, Logger):
|
||||
def set_ln_invoice(self, invoice: str):
|
||||
try:
|
||||
invoice = str(invoice).lower()
|
||||
lnaddr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP)
|
||||
lnaddr = lndecode(invoice)
|
||||
except Exception as e:
|
||||
self.app.show_info(invoice + _(" is not a valid Lightning invoice: ") + repr(e)) # repr because str(Exception()) == ''
|
||||
return
|
||||
|
||||
@@ -1969,7 +1969,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||
def parse_lightning_invoice(self, invoice):
|
||||
"""Parse ln invoice, and prepare the send tab for it."""
|
||||
try:
|
||||
lnaddr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP)
|
||||
lnaddr = lndecode(invoice)
|
||||
except Exception as e:
|
||||
raise LnDecodeException(e) from e
|
||||
pubkey = bh2u(lnaddr.pubkey.serialize())
|
||||
@@ -2180,7 +2180,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
|
||||
d.exec_()
|
||||
|
||||
def show_lightning_invoice(self, invoice: LNInvoice):
|
||||
lnaddr = lndecode(invoice.invoice, expected_hrp=constants.net.SEGWIT_HRP)
|
||||
lnaddr = lndecode(invoice.invoice)
|
||||
d = WindowModalDialog(self, _("Lightning Invoice"))
|
||||
vbox = QVBoxLayout(d)
|
||||
grid = QGridLayout()
|
||||
|
||||
Reference in New Issue
Block a user