File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -3918,14 +3918,16 @@ where
3918
3918
htlcs. push( claimable_htlc) ;
3919
3919
let amount_msat = htlcs. iter( ) . map( |htlc| htlc. value) . sum( ) ;
3920
3920
htlcs. iter_mut( ) . for_each( |htlc| htlc. total_value_received = Some ( amount_msat) ) ;
3921
+ let counterparty_skimmed_fee_msat = htlcs. iter( )
3922
+ . map( |htlc| htlc. counterparty_skimmed_fee_msat. unwrap_or( 0 ) ) . sum( ) ;
3923
+ debug_assert!( total_value. saturating_sub( amount_msat) <=
3924
+ counterparty_skimmed_fee_msat) ;
3921
3925
new_events. push_back( ( events:: Event :: PaymentClaimable {
3922
3926
receiver_node_id: Some ( receiver_node_id) ,
3923
3927
payment_hash,
3924
3928
purpose: $purpose,
3925
3929
amount_msat,
3926
- counterparty_skimmed_fee_msat:
3927
- cmp:: max( total_value. saturating_sub( amount_msat) , htlcs. iter( )
3928
- . map( |htlc| htlc. counterparty_skimmed_fee_msat. unwrap_or( 0 ) ) . sum( ) ) ,
3930
+ counterparty_skimmed_fee_msat,
3929
3931
via_channel_id: Some ( prev_channel_id) ,
3930
3932
via_user_channel_id: Some ( prev_user_channel_id) ,
3931
3933
claim_deadline: Some ( earliest_expiry - HTLC_FAIL_BACK_BUFFER ) ,
You can’t perform that action at this time.
0 commit comments