1
0

lnwatcher: keep_watching should wait at least until closing_tx is deep

Even if it decides there is nothing to sweep from the ctx/etc, it still needs to
keep watching until a reorg-safe depth.
This commit is contained in:
SomberNight
2025-06-27 11:37:23 +00:00
parent 6ce8eb12f7
commit a1a55db39c
2 changed files with 8 additions and 4 deletions

View File

@@ -202,9 +202,10 @@ class WatchTower(Logger, EventListener):
result.update(r)
return result
async def sweep_commitment_transaction(self, funding_outpoint, closing_tx):
async def sweep_commitment_transaction(self, funding_outpoint: str, closing_tx: Transaction) -> bool:
assert closing_tx
spenders = self.inspect_tx_candidate(funding_outpoint, 0)
keep_watching = False
keep_watching = not self.adb.is_deeply_mined(closing_tx.txid())
for prevout, spender in spenders.items():
if spender is not None:
keep_watching |= not self.adb.is_deeply_mined(spender)