@@ -1763,16 +1763,19 @@ fn do_test_revoked_counterparty_htlc_tx_balances(anchors: bool) {
1763
1763
mine_transaction ( & nodes[ 0 ] , & revoked_htlc_timeout) ;
1764
1764
let ( revoked_htlc_timeout_claim, revoked_to_self_claim) = {
1765
1765
let mut as_second_htlc_claim_tx = nodes[ 0 ] . tx_broadcaster . txn_broadcast ( ) ;
1766
- assert_eq ! ( as_second_htlc_claim_tx. len( ) , if anchors { 1 } else { 2 } ) ;
1766
+
1767
+ let min_claim_tx_count = if anchors { 1 } else { 2 } ;
1768
+ let max_claim_tx_count = min_claim_tx_count + 1 ;
1769
+ assert ! ( as_second_htlc_claim_tx. len( ) >= min_claim_tx_count) ;
1770
+ assert ! ( as_second_htlc_claim_tx. len( ) <= max_claim_tx_count) ;
1771
+
1772
+ assert_eq ! ( as_second_htlc_claim_tx[ 0 ] . input. len( ) , 1 ) ;
1773
+ assert_eq ! ( as_second_htlc_claim_tx[ 0 ] . input[ 0 ] . previous_output. vout, 0 ) ;
1774
+ check_spends ! ( as_second_htlc_claim_tx[ 0 ] , revoked_htlc_timeout) ;
1775
+
1767
1776
if anchors {
1768
- assert_eq ! ( as_second_htlc_claim_tx[ 0 ] . input. len( ) , 1 ) ;
1769
- assert_eq ! ( as_second_htlc_claim_tx[ 0 ] . input[ 0 ] . previous_output. vout, 0 ) ;
1770
- check_spends ! ( as_second_htlc_claim_tx[ 0 ] , revoked_htlc_timeout) ;
1771
1777
( as_second_htlc_claim_tx. remove ( 0 ) , revoked_to_self_claim. unwrap ( ) )
1772
1778
} else {
1773
- assert_eq ! ( as_second_htlc_claim_tx[ 0 ] . input. len( ) , 1 ) ;
1774
- assert_eq ! ( as_second_htlc_claim_tx[ 0 ] . input[ 0 ] . previous_output. vout, 0 ) ;
1775
- check_spends ! ( as_second_htlc_claim_tx[ 0 ] , revoked_htlc_timeout) ;
1776
1779
assert_eq ! ( as_second_htlc_claim_tx[ 1 ] . input. len( ) , 1 ) ;
1777
1780
assert_eq ! ( as_second_htlc_claim_tx[ 1 ] . input[ 0 ] . previous_output. vout, 2 ) ;
1778
1781
check_spends ! ( as_second_htlc_claim_tx[ 1 ] , revoked_local_txn[ 0 ] ) ;
0 commit comments