Skip to content

Commit e76ac33

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 66ced68 commit e76ac33

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
@@ -130,7 +130,8 @@ fn do_test_onchain_htlc_reorg(local_commitment: bool, claim: bool) {
130130
assert_eq!(nodes[1].node.get_and_clear_pending_events().len(), 0);
131131

132132
if claim {
133-
disconnect_blocks(&nodes[1], ANTI_REORG_DELAY - 2);
133+
// Disconnect Node 1's HTLC-Timeout which was connected above
134+
disconnect_blocks(&nodes[1], ANTI_REORG_DELAY - 1);
134135

135136
let block = Block {
136137
header: BlockHeader { version: 0x20000000, prev_blockhash: nodes[1].best_block_hash(), merkle_root: TxMerkleNode::all_zeros(), time: 42, bits: 42, nonce: 42 },

0 commit comments

Comments
 (0)