X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fln%2Ffunctional_tests.rs;h=7667ce45aa74f60af6e9748daa6b4b79088da52c;hb=6eb290d780946de7f5d6b3e9a85598062a17b92c;hp=88a10dc6b8192a08b16199c80594856b84c354ea;hpb=116b1eb028e02f32718ddd688348f64b719de31e;p=rust-lightning diff --git a/lightning/src/ln/functional_tests.rs b/lightning/src/ln/functional_tests.rs index 88a10dc6..7667ce45 100644 --- a/lightning/src/ln/functional_tests.rs +++ b/lightning/src/ln/functional_tests.rs @@ -1783,8 +1783,10 @@ fn channel_monitor_network_test() { // nodes[3] gets the preimage, but nodes[2] already disconnected, resulting in a nodes[2] // HTLC-Timeout and a nodes[3] claim against it (+ its own announces) nodes[2].node.peer_disconnected(&nodes[3].node.get_our_node_id(), true); + let node2_commitment_txid; { let node_txn = test_txn_broadcast(&nodes[2], &chan_3, None, HTLCType::TIMEOUT); + node2_commitment_txid = node_txn[0].txid(); // Claim the payment on nodes[3], giving it knowledge of the preimage claim_funds!(nodes[3], nodes[2], payment_preimage_1, 3_000_000); @@ -1818,6 +1820,16 @@ fn channel_monitor_network_test() { nodes[3].block_notifier.block_connected_checked(&header, i, &Vec::new()[..], &[0; 0]); } + // Clear bumped claiming txn spending node 2 commitment tx. Bumped txn are generated after reaching some height timer. + { + let mut node_txn = nodes[3].tx_broadcaster.txn_broadcasted.lock().unwrap(); + node_txn.retain(|tx| { + if tx.input[0].previous_output.txid == node2_commitment_txid { + false + } else { true } + }); + } + let node_txn = test_txn_broadcast(&nodes[3], &chan_4, None, HTLCType::TIMEOUT); // Claim the payment on nodes[4], giving it knowledge of the preimage