File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -3338,6 +3338,8 @@ where
3338
3338
_ => unreachable!( ) ,
3339
3339
}
3340
3340
}
3341
+ // The condition determining whether an MPP is complete must
3342
+ // match exactly the condition used in `timer_tick_occurred`
3341
3343
if total_value >= msgs:: MAX_VALUE_MSAT {
3342
3344
fail_htlc!( claimable_htlc, payment_hash) ;
3343
3345
} else if total_value - claimable_htlc. sender_intended_value >= $payment_data. total_msat {
@@ -3672,7 +3674,9 @@ where
3672
3674
if let OnionPayload :: Invoice { .. } = htlcs[ 0 ] . onion_payload {
3673
3675
// Check if we've received all the parts we need for an MPP (the value of the parts adds to total_msat).
3674
3676
// In this case we're not going to handle any timeouts of the parts here.
3675
- if htlcs[ 0 ] . total_msat <= htlcs. iter ( ) . fold ( 0 , |total, htlc| total + htlc. value ) {
3677
+ // This condition determining whether the MPP is complete here must match
3678
+ // exactly the condition used in `process_pending_htlc_forwards`.
3679
+ if htlcs[ 0 ] . total_msat <= htlcs. iter ( ) . fold ( 0 , |total, htlc| total + htlc. sender_intended_value ) {
3676
3680
return true ;
3677
3681
} else if htlcs. into_iter ( ) . any ( |htlc| {
3678
3682
htlc. timer_ticks += 1 ;
You can’t perform that action at this time.
0 commit comments