Skip to content

Commit cdbd336

Browse files
committed
Fix off-by-one in test_onchain_htlc_claim_reorg_remote_commitment
The test intended to disconnect a transaction previously connected but didn't disconnect enough blocks to do so, leading to it confirming two conflicting transactions. In the next few commits this will become an assertion failure.
1 parent 52bb4c9 commit cdbd336

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightning/src/ln/reorg_tests.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ fn do_test_onchain_htlc_reorg(local_commitment: bool, claim: bool) {
128128
assert_eq!(nodes[1].node.get_and_clear_pending_events().len(), 0);
129129

130130
if claim {
131-
disconnect_blocks(&nodes[1], ANTI_REORG_DELAY - 2);
131+
// Disconnect Node 1's HTLC-Timeout which was connected above
132+
disconnect_blocks(&nodes[1], ANTI_REORG_DELAY - 1);
132133

133134
let block = Block {
134135
header: BlockHeader { version: 0x20000000, prev_blockhash: nodes[1].best_block_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42 },

0 commit comments

Comments
 (0)