1
0

SweepInfo: define csv_delay as property

This commit is contained in:
ThomasV
2025-05-13 08:50:33 +02:00
parent 0607a406ce
commit 6e3f173a71
4 changed files with 7 additions and 25 deletions

View File

@@ -102,10 +102,8 @@ class TxBatcher(Logger):
@locked
def add_sweep_input(self, key: str, sweep_info: 'SweepInfo', fee_policy_descriptor: str):
# sanity check csv_delay (note: values differ for swaps)
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
# detect legacy htlc using name and csv delay
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}')