LN invoice: better handle unknown required featured bits in bolt11 invs
A user provided an invoice that requires feature bit 30. (That bit is not in the spec) To test: ``` lnbc1p324a66pp5tundykxx3q5kztsr8x00eknpn2uwe3394cnky3j9a0fswm568wnsdp9facx2mj5d9kk2um5v9khqueqv3hkuct5d9hkucqzpgxq9z0rgqsp5l73jgfgctzc92juer5rk2mqcrkj8teng53dr9vfxj4n8lulu4jmq9q8pqqqssq4gacn859tpzz99hkusnh7m93d5ncpx3t4zns8ynca7akmljpl5vh504qjz7dqwewqjh4md7xagaz5wg85knvxywrhp0sp2t09yta7lcq3qs6fy lntb1p324a66pp5tundykxx3q5kztsr8x00eknpn2uwe3394cnky3j9a0fswm568wnssp5l73jgfgctzc92juer5rk2mqcrkj8teng53dr9vfxj4n8lulu4jmqdp9facx2mj5d9kk2um5v9khqueqv3hkuct5d9hkuxq9z0rgq9q8pqqqssqdte0z9dy7ur7fagsk7r3mtfj6upq88xfylhufys87zqpamklcfgn2f3xeq3nlhvn3qy9tdgg42vq9eq99qz6rz6tzqezfhzuv6zsr5qp7cgel4 ```
This commit is contained in:
@@ -16,6 +16,7 @@ from electrum.invoices import (PR_DEFAULT_EXPIRATION_WHEN_CREATING,
|
||||
PR_PAID, PR_UNKNOWN, PR_EXPIRED, PR_INFLIGHT,
|
||||
pr_expiration_values, Invoice)
|
||||
from electrum import bitcoin, constants
|
||||
from electrum import lnutil
|
||||
from electrum.transaction import tx_from_any, PartialTxOutput
|
||||
from electrum.util import (parse_URI, InvalidBitcoinURI, TxMinedInfo, maybe_extract_lightning_payment_identifier,
|
||||
InvoiceError, format_time, parse_max_spend, BITCOIN_BIP21_URI_SCHEME)
|
||||
@@ -224,6 +225,9 @@ class SendScreen(CScreen, Logger):
|
||||
except LnInvoiceException as e:
|
||||
self.app.show_info(_("Invoice is not a valid Lightning invoice: ") + repr(e)) # repr because str(Exception()) == ''
|
||||
return
|
||||
except lnutil.IncompatibleOrInsaneFeatures as e:
|
||||
self.app.show_info(_("Invoice requires unknown or incompatible Lightning feature") + f":\n{e!r}")
|
||||
return
|
||||
self.address = invoice
|
||||
self.message = lnaddr.get_description()
|
||||
self.amount = self.app.format_amount_and_units(lnaddr.amount * bitcoin.COIN) if lnaddr.amount else ''
|
||||
|
||||
Reference in New Issue
Block a user