1
0

Index lightning requests with rhash instead of onchain address.

get_unused_addresses() has been broken since #7730, because
addresses are considered as permanently used if they are in
the list of keys of receive_requests. This is true even if
an address is used as fallback for a lightning payment. This
means that the number of lightning payments we can receive
is constrained by the gap limit.

If a payment succeeds off-chain, we want to be able to reuse
its fallback address in other requests (this does not reduce
privacy, because invoices already share the same public key).

This implies that we should not use the onchain address as key
for lightning-enabled requests in wallet.receive_requests. If
we did, paid invoices would be overwritten when the address is
reused. That is the reason for the wallet_db upgrade.

Related: a3faf85e3c
This commit is contained in:
ThomasV
2022-06-15 16:24:29 +02:00
parent adb5b6213b
commit 9fe93524b7
4 changed files with 37 additions and 22 deletions

View File

@@ -105,7 +105,7 @@ class MockWallet:
receive_requests = {}
adb = MockADB()
def get_request_by_rhash(self, rhash):
def get_request(self, key):
pass
def get_key_for_receive_request(self, x):