1
0

lnworker: make "preimages" dict private

I want to hook into lnworker.save_preimage (not done yet).
Other modules should not put preimages into the dict directly.
This commit is contained in:
SomberNight
2025-05-14 13:23:02 +00:00
parent 37352ea5a9
commit 44f3444795
4 changed files with 13 additions and 9 deletions

View File

@@ -206,7 +206,7 @@ class MockLNWallet(Logger, EventListener, NetworkRetryManager[LNPeerAddr]):
self.active_forwardings = {}
self.forwarding_failures = {}
self.inflight_payments = set()
self.preimages = {}
self._preimages = {}
self.stopping_soon = False
self.downstream_to_upstream_htlc = {}
self.dont_settle_htlcs = {}
@@ -593,7 +593,7 @@ class TestPeer(ElectrumTestCase):
def prepare_recipient(self, w2, payment_hash, test_hold_invoice, test_failure):
if not test_hold_invoice and not test_failure:
return
preimage = bytes.fromhex(w2.preimages.pop(payment_hash.hex()))
preimage = bytes.fromhex(w2._preimages.pop(payment_hash.hex()))
if test_hold_invoice:
async def cb(payment_hash):
if not test_failure: