- assert_eq!(claim_txn[1], claim_txn[4]);
- assert_eq!(claim_txn[2], claim_txn[5]);
- check_spends!(claim_txn[1], chan_1.3);
- check_spends!(claim_txn[2], claim_txn[1]);
- check_spends!(claim_txn[7], claim_txn[1]);
+
+ check_spends!(claim_txn[0], remote_txn[0]); // Immediate HTLC claim with preimage
+
+ check_spends!(claim_txn[1], chan_1.3); // Alternative commitment tx
+ check_spends!(claim_txn[2], claim_txn[1]); // HTLC spend in alternative commitment tx
+
+ let bump_tx = if claim_txn[1] == claim_txn[4] {
+ assert_eq!(claim_txn[1], claim_txn[4]);
+ assert_eq!(claim_txn[2], claim_txn[5]);
+
+ check_spends!(claim_txn[7], claim_txn[1]); // HTLC timeout on alternative commitment tx
+
+ check_spends!(claim_txn[3], remote_txn[0]); // HTLC timeout on broadcasted commitment tx
+ &claim_txn[3]
+ } else {
+ assert_eq!(claim_txn[1], claim_txn[3]);
+ assert_eq!(claim_txn[2], claim_txn[4]);
+
+ check_spends!(claim_txn[5], claim_txn[1]); // HTLC timeout on alternative commitment tx
+
+ check_spends!(claim_txn[7], remote_txn[0]); // HTLC timeout on broadcasted commitment tx
+
+ &claim_txn[7]
+ };