Skip to content

Commit edf279f

Browse files
committed
Add ChannelManager::fail_htlc_backwards_with_reason
This function allows a user to specify the error code and corresponding data to send to peers when failing back an HTLC. This function is mentioned in Event::PaymentClaimable docs.
1 parent 803cf3f commit edf279f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lightning/src/util/events.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -491,10 +491,10 @@ pub enum Event {
491491
/// [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`].
492492
///
493493
/// Note that if the preimage is not known, you should call
494-
/// [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid
495-
/// network congestion.
496-
/// If you fail to call either [`ChannelManager::claim_funds`] or
497-
/// [`ChannelManager::fail_htlc_backwards`] within the HTLC's timeout, the HTLC will be
494+
/// [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
495+
/// to free up resources for this HTLC and avoid network congestion.
496+
/// If you fail to call either [`ChannelManager::claim_funds`],[`ChannelManager::fail_htlc_backwards`],
497+
/// or [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will be
498498
/// automatically failed.
499499
///
500500
/// # Note
@@ -506,6 +506,7 @@ pub enum Event {
506506
///
507507
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
508508
/// [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
509+
/// [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason
509510
PaymentClaimable {
510511
/// The node that will receive the payment after it has been claimed.
511512
/// This is useful to identify payments received via [phantom nodes].

0 commit comments

Comments
 (0)