Skip to content

Commit 4883eba

Browse files
committed
Fix one test still connecting invalid blocks
In the next commit we'll add some checks that redundant transactions aren't confirmed in different blocks, which would cause test_htlc_ignore_latest_remote_commitment to fail. Here we fix it to avoid the issue.
1 parent 7269fa2 commit 4883eba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/ln/functional_tests.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -3370,6 +3370,12 @@ fn test_htlc_ignore_latest_remote_commitment() {
33703370
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
33713371
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
33723372
let nodes = create_network(2, &node_cfgs, &node_chanmgrs);
3373+
if *nodes[1].connect_style.borrow() == ConnectStyle::FullBlockViaListen {
3374+
// We rely on the ability to connect a block redundantly, which isn't allowed via
3375+
// `chain::Listen`, so we never run the test if we randomly get assigned that
3376+
// connect_style.
3377+
return;
3378+
}
33733379
create_announced_chan_between_nodes(&nodes, 0, 1, channelmanager::provided_init_features(), channelmanager::provided_init_features());
33743380

33753381
route_payment(&nodes[0], &[&nodes[1]], 10000000);
@@ -3391,7 +3397,6 @@ fn test_htlc_ignore_latest_remote_commitment() {
33913397

33923398
// Duplicate the connect_block call since this may happen due to other listeners
33933399
// registering new transactions
3394-
header.prev_blockhash = header.block_hash();
33953400
connect_block(&nodes[1], &Block { header, txdata: vec![node_txn[0].clone(), node_txn[2].clone()]});
33963401
}
33973402

0 commit comments

Comments
 (0)