1
0

LN cooperative close: avoid address-reuse (#6590)

Previously if we coop-closed multiple channels in the same session,
they would reuse the wallet address.
This commit is contained in:
ghost43
2020-09-15 15:37:47 +00:00
committed by GitHub
parent fc89c8ffa9
commit 3eba26b398
4 changed files with 28 additions and 7 deletions

View File

@@ -494,7 +494,8 @@ class LNWallet(LNWorker):
self.features |= LnFeatures.OPTION_STATIC_REMOTEKEY_REQ
self.payments = self.db.get_dict('lightning_payments') # RHASH -> amount, direction, is_paid # FIXME amt should be msat
self.preimages = self.db.get_dict('lightning_preimages') # RHASH -> preimage
self.sweep_address = wallet.get_new_sweep_address_for_channel() # TODO possible address-reuse
# note: this sweep_address is only used as fallback; as it might result in address-reuse
self.sweep_address = wallet.get_new_sweep_address_for_channel()
self.logs = defaultdict(list) # type: Dict[str, List[PaymentAttemptLog]] # key is RHASH # (not persisted)
self.is_routing = set() # (not persisted) keys of invoices that are in PR_ROUTING state
# used in tests