@@ -5329,16 +5329,11 @@ fn test_onchain_to_onchain_claim() {
5329
5329
// So we broadcast C's commitment tx and HTLC-Success on B's chain, we should successfully be able to extract preimage and update downstream monitor
5330
5330
let header = BlockHeader { version: 0x20000000, prev_blockhash: nodes[1].best_block_hash(), merkle_root: Default::default(), time: 42, bits: 42, nonce: 42};
5331
5331
connect_block(&nodes[1], &Block { header, txdata: vec![c_txn[1].clone(), c_txn[2].clone()]});
5332
- connect_blocks(&nodes[1], TEST_FINAL_CLTV - 1); // Confirm blocks until the HTLC expires
5333
5332
{
5334
5333
let mut b_txn = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap();
5335
- // ChannelMonitor: claim tx, ChannelManager: local commitment tx
5336
- assert_eq!(b_txn.len(), 2 );
5334
+ // ChannelMonitor: claim tx
5335
+ assert_eq!(b_txn.len(), 1 );
5337
5336
check_spends!(b_txn[0], chan_2.3); // B local commitment tx, issued by ChannelManager
5338
- check_spends!(b_txn[1], c_txn[1]); // timeout tx on C remote commitment tx, issued by ChannelMonitor
5339
- assert_eq!(b_txn[1].input[0].witness.clone().last().unwrap().len(), ACCEPTED_HTLC_SCRIPT_WEIGHT);
5340
- assert!(b_txn[1].output[0].script_pubkey.is_v0_p2wpkh()); // direct payment
5341
- assert_ne!(b_txn[1].lock_time, 0); // Timeout tx
5342
5337
b_txn.clear();
5343
5338
}
5344
5339
check_added_monitors!(nodes[1], 1);
@@ -5367,19 +5362,14 @@ fn test_onchain_to_onchain_claim() {
5367
5362
let commitment_tx = get_local_commitment_txn!(nodes[0], chan_1.2);
5368
5363
mine_transaction(&nodes[1], &commitment_tx[0]);
5369
5364
let b_txn = nodes[1].tx_broadcaster.txn_broadcasted.lock().unwrap();
5370
- // ChannelMonitor: HTLC-Success tx + HTLC-Timeout RBF Bump, ChannelManager: local commitment tx + HTLC-Success tx
5371
- assert_eq!(b_txn.len(), 4);
5372
- check_spends!(b_txn[2], chan_1.3);
5373
- check_spends!(b_txn[3], b_txn[2]);
5374
- let (htlc_success_claim, htlc_timeout_bumped) =
5375
- if b_txn[0].input[0].previous_output.txid == commitment_tx[0].txid()
5376
- { (&b_txn[0], &b_txn[1]) } else { (&b_txn[1], &b_txn[0]) };
5377
- check_spends!(htlc_success_claim, commitment_tx[0]);
5378
- assert_eq!(htlc_success_claim.input[0].witness.clone().last().unwrap().len(), OFFERED_HTLC_SCRIPT_WEIGHT);
5379
- assert!(htlc_success_claim.output[0].script_pubkey.is_v0_p2wpkh()); // direct payment
5380
- assert_eq!(htlc_success_claim.lock_time, 0); // Success tx
5381
- check_spends!(htlc_timeout_bumped, c_txn[1]); // timeout tx on C remote commitment tx, issued by ChannelMonitor
5382
- assert_ne!(htlc_timeout_bumped.lock_time, 0); // Success tx
5365
+ // ChannelMonitor: HTLC-Success tx, ChannelManager: local commitment tx + HTLC-Success tx
5366
+ assert_eq!(b_txn.len(), 3);
5367
+ check_spends!(b_txn[1], chan_1.3);
5368
+ check_spends!(b_txn[2], b_txn[1]);
5369
+ check_spends!(b_txn[0], commitment_tx[0]);
5370
+ assert_eq!(b_txn[0].input[0].witness.clone().last().unwrap().len(), OFFERED_HTLC_SCRIPT_WEIGHT);
5371
+ assert!(b_txn[0].output[0].script_pubkey.is_v0_p2wpkh()); // direct payment
5372
+ assert_eq!(b_txn[0].lock_time, 0); // Success tx
5383
5373
5384
5374
check_closed_broadcast!(nodes[1], true);
5385
5375
check_added_monitors!(nodes[1], 1);
0 commit comments