Skip to content

Commit f933a5f

Browse files
committed
f new comment
1 parent 484705b commit f933a5f

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,21 +3981,10 @@ where
39813981
};
39823982
debug_assert!(!sources.is_empty());
39833983

3984-
// If we are claiming an MPP payment, we check that all channels which contain a claimable
3985-
// HTLC still exist. While this isn't guaranteed to remain true if a channel closes while
3986-
// we're claiming (or even after we claim, before the commitment update dance completes),
3987-
// it should be a relatively rare race, and we'd rather not claim HTLCs that require us to
3988-
// go on-chain (and lose the on-chain fee to do so) than just reject the payment.
3989-
//
3990-
// Note that we'll still always get our funds - as long as the generated
3991-
// `ChannelMonitorUpdate` makes it out to the relevant monitor we can claim on-chain.
3992-
//
3993-
// If we find an HTLC which we would need to claim but for which we do not have a
3994-
// channel, we will fail all parts of the MPP payment. While we could wait and see if
3995-
// the sender retries the already-failed path(s), it should be a pretty rare case where
3996-
// we got all the HTLCs and then a channel closed while we were waiting for the user to
3997-
// provide the preimage, so worrying too much about the optimal handling isn't worth
3998-
// it.
3984+
// Just in case one HTLC has been failed between when we generated the `PaymentClaimable`
3985+
// and when we got here we need to check that the amount we're about to claim matches the
3986+
// amount we told the user in the last `PaymentClaimable`. We also do a sanity-check that
3987+
// the MPP parts all have the same `total_msat`.
39993988
let mut claimable_amt_msat = 0;
40003989
let mut prev_total_msat = None;
40013990
let mut expected_amt_msat = None;

0 commit comments

Comments
 (0)