1
0
Commit Graph

17 Commits

Author SHA1 Message Date
SomberNight
a66b0c6a12 lnaddr: rm some tests where feature bits do not make sense
Not all feature flags are supposed to go into the invoice.
2023-06-29 13:55:15 +00:00
SomberNight
a3b0e97c88 lnaddr: make min_cltv logic less error-prone
round-tripping the value behaved unexpectedly before...
2023-06-23 19:53:34 +00:00
Jeremy Rand
1aa444e0f8 Fix "== None" linter fails
Credit to Zoltan Konder for pointing me to this issue.
2022-05-24 02:39:11 +00:00
bitromortac
6716004b47 bolt11: fix amount encoding for large values 2021-07-30 08:44:15 +02:00
SomberNight
57e52da77f 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.
2021-06-22 16:16:21 +02:00
SomberNight
4315fa4371 BIP-0350: use bech32m for witness version 1+ addresses
We have supported sending to any witness version since Electrum 3.0, using
addresses as specified in BIP-0173 (bech32 encoding).
BIP-0350 makes a breaking change in address encoding, and recommends using
(and using only) a new encoding (bech32m) for sending to witness version 1
and later. The address encoding for currently in use witness v0 addresses
remains the same, as in BIP-0173; following the BIP-0350 spec.

closes https://github.com/spesmilo/electrum/issues/6949

related:
cd3885c0fb/bip-0350.mediawiki
https://github.com/bitcoin/bitcoin/pull/20861
2021-03-17 18:11:55 +01:00
SomberNight
fa999de305 tests: re bolt11 tests, also check invoice str in test_roundtrip 2021-03-16 20:39:51 +01:00
SomberNight
4069b455d0 lnaddr: add get_features method 2021-03-08 21:36:27 +01:00
SomberNight
18066c72a0 lnaddr: fix decoding of min_final_cltv_expiry
Previously we failed to decode min_final_cltv_expiry properly if the highest bit was 1:
in practice, we could not pay invoices that had a value in [16-31] or [512-1023].
Many invoices use a value around 144, so this was simply unnoticed.

also update default value to follow BOLT change:
c5693d336d
2020-11-24 23:42:29 +01:00
SomberNight
71635216df ln feature bits: validate transitive feature deps everywhere 2020-04-01 21:49:19 +02:00
SomberNight
1be0a710c3 ln: implement option payment_secret 2020-04-01 21:49:12 +02:00
SomberNight
4b78bf94d4 lnaddr: add feature bit support to invoices
see https://github.com/lightningnetwork/lightning-rfc/pull/656
2020-04-01 21:42:52 +02:00
SomberNight
7c283f9cd2 fix tests: follow-up prev 2019-10-01 20:42:34 +02:00
SomberNight
04edad9984 config: no longer singleton. it is passed to Wallet.__init__
The few other cases that used SimpleConfig.get_instance() now
either get passed a config instance, or they try to get a reference
to something else that has a reference to a config.
(see lnsweep, qt/qrcodewidget, qt/qrtextedit)
2019-09-22 20:46:01 +02:00
Janus
1520338f37 fix ln tests 2019-08-20 09:03:11 +02:00
SomberNight
e6a0b641d5 lnaddr: encode min_final_cltv into invoice 2019-08-20 09:03:10 +02:00
Janus
35adc3231b lightning: fixup after rebasing on restructured master 2019-08-20 09:03:10 +02:00