@@ -3065,7 +3065,7 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
3065
3065
} ;
3066
3066
3067
3067
macro_rules! walk_htlcs {
3068
- ( $holder_commitment : expr , $ htlc_iter: expr) => {
3068
+ ( $htlc_iter: expr) => {
3069
3069
let mut walk_candidate_htlcs = |htlcs| {
3070
3070
for & ( ref candidate_htlc, ref candidate_source) in htlcs {
3071
3071
let candidate_htlc: & HTLCOutputInCommitment = & candidate_htlc;
@@ -3108,14 +3108,12 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
3108
3108
// We walk the set of HTLCs in the unrevoked counterparty commitment transactions (see
3109
3109
// `fail_unbroadcast_htlcs` for a description of why).
3110
3110
if let Some ( ref txid) = us. funding. current_counterparty_commitment_txid {
3111
- if let Some ( htlcs) = us. funding. counterparty_claimable_outpoints. get( txid) {
3112
- walk_candidate_htlcs( htlcs) ;
3113
- }
3111
+ let htlcs = us. funding. counterparty_claimable_outpoints. get( txid) ;
3112
+ walk_candidate_htlcs( htlcs. expect( "Missing tx info for latest tx" ) ) ;
3114
3113
}
3115
3114
if let Some ( ref txid) = us. funding. prev_counterparty_commitment_txid {
3116
- if let Some ( htlcs) = us. funding. counterparty_claimable_outpoints. get( txid) {
3117
- walk_candidate_htlcs( htlcs) ;
3118
- }
3115
+ let htlcs = us. funding. counterparty_claimable_outpoints. get( txid) ;
3116
+ walk_candidate_htlcs( htlcs. expect( "Missing tx info for previous tx" ) ) ;
3119
3117
}
3120
3118
} ;
3121
3119
}
@@ -3127,7 +3125,6 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
3127
3125
{
3128
3126
let htlcs = funding. counterparty_claimable_outpoints . get ( & confirmed_txid) . unwrap ( ) ;
3129
3127
walk_htlcs ! (
3130
- false ,
3131
3128
htlcs. iter( ) . filter_map( |( a, b) | {
3132
3129
if let & Some ( ref source) = b {
3133
3130
Some ( ( a, Some ( & * * source) ) )
@@ -3137,17 +3134,17 @@ impl<Signer: EcdsaChannelSigner> ChannelMonitor<Signer> {
3137
3134
} )
3138
3135
) ;
3139
3136
} else if confirmed_txid == funding. current_holder_commitment_tx . trust ( ) . txid ( ) {
3140
- walk_htlcs ! ( true , holder_commitment_htlcs!( us, CURRENT_WITH_SOURCES ) ) ;
3137
+ walk_htlcs ! ( holder_commitment_htlcs!( us, CURRENT_WITH_SOURCES ) ) ;
3141
3138
} else if let Some ( prev_commitment_tx) = & funding. prev_holder_commitment_tx {
3142
3139
if confirmed_txid == prev_commitment_tx. trust ( ) . txid ( ) {
3143
- walk_htlcs ! ( true , holder_commitment_htlcs!( us, PREV_WITH_SOURCES ) . unwrap( ) ) ;
3140
+ walk_htlcs ! ( holder_commitment_htlcs!( us, PREV_WITH_SOURCES ) . unwrap( ) ) ;
3144
3141
} else {
3145
3142
let htlcs_confirmed: & [ ( & HTLCOutputInCommitment , _ ) ] = & [ ] ;
3146
- walk_htlcs ! ( false , htlcs_confirmed. iter( ) ) ;
3143
+ walk_htlcs ! ( htlcs_confirmed. iter( ) ) ;
3147
3144
}
3148
3145
} else {
3149
3146
let htlcs_confirmed: & [ ( & HTLCOutputInCommitment , _ ) ] = & [ ] ;
3150
- walk_htlcs ! ( false , htlcs_confirmed. iter( ) ) ;
3147
+ walk_htlcs ! ( htlcs_confirmed. iter( ) ) ;
3151
3148
}
3152
3149
3153
3150
res
0 commit comments