1
0

Qt: add closing warning if we have an unconfirmed local commitment tx with htlcs

add htlc direction (offered, received) to the htlc sweep_info name
regtest: add test_reedeem_received_htlcs
This commit is contained in:
ThomasV
2025-05-08 19:28:05 +02:00
parent 7d6c21f233
commit 0607a406ce
8 changed files with 81 additions and 13 deletions

View File

@@ -106,7 +106,7 @@ class TxBatcher(Logger):
assert sweep_info.csv_delay >= (sweep_info.txin.get_block_based_relative_locktime() or 0)
if sweep_info.txin and sweep_info.txout:
# todo: don't use name, detect sighash
if sweep_info.name == 'first-stage-htlc':
if sweep_info.name in ['received-htlc', 'offered-htlc'] and sweep_info.csv_delay == 0:
if sweep_info.txin.prevout not in self._legacy_htlcs:
self.logger.info(f'received {sweep_info.name}')
self._legacy_htlcs[sweep_info.txin.prevout] = sweep_info