@@ -3922,7 +3922,7 @@ where
39223922 }
39233923
39243924 for htlc_source in failed_htlcs.drain(..) {
3925- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
3925+ let failure_reason = LocalHTLCFailureReason::ChannelClosed ;
39263926 let reason = HTLCFailReason::from_failure_code(failure_reason);
39273927 let receiver = HTLCDestination::NextHopChannel { node_id: Some(*counterparty_node_id), channel_id: *channel_id };
39283928 self.fail_htlc_backwards_internal(&htlc_source.0, &htlc_source.1, &reason, receiver);
@@ -4046,7 +4046,7 @@ where
40464046 shutdown_res.closure_reason, shutdown_res.dropped_outbound_htlcs.len());
40474047 for htlc_source in shutdown_res.dropped_outbound_htlcs.drain(..) {
40484048 let (source, payment_hash, counterparty_node_id, channel_id) = htlc_source;
4049- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
4049+ let failure_reason = LocalHTLCFailureReason::ChannelClosed ;
40504050 let reason = HTLCFailReason::from_failure_code(failure_reason);
40514051 let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
40524052 self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
@@ -4349,19 +4349,19 @@ where
43494349 // should NOT reveal the existence or non-existence of a private channel if
43504350 // we don't allow forwards outbound over them.
43514351 return Err(("Refusing to forward to a private channel based on our config.",
4352- LocalHTLCFailureReason::UnknownNextPeer ));
4352+ LocalHTLCFailureReason::PrivateChannelForward ));
43534353 }
43544354 if let HopConnector::ShortChannelId(outgoing_scid) = next_packet.outgoing_connector {
43554355 if chan.funding.get_channel_type().supports_scid_privacy() && outgoing_scid != chan.context.outbound_scid_alias() {
43564356 // `option_scid_alias` (referred to in LDK as `scid_privacy`) means
43574357 // "refuse to forward unless the SCID alias was used", so we pretend
43584358 // we don't have the channel here.
43594359 return Err(("Refusing to forward over real channel SCID as our counterparty requested.",
4360- LocalHTLCFailureReason::UnknownNextPeer ));
4360+ LocalHTLCFailureReason::RealSCIDForward ));
43614361 }
43624362 } else {
43634363 return Err(("Cannot forward by Node ID without SCID.",
4364- LocalHTLCFailureReason::UnknownNextPeer ));
4364+ LocalHTLCFailureReason::InvalidTrampolineForward ));
43654365 }
43664366
43674367 // Note that we could technically not return an error yet here and just hope
@@ -4375,7 +4375,7 @@ where
43754375 LocalHTLCFailureReason::ChannelDisabled));
43764376 } else {
43774377 return Err(("Forwarding channel is not in a ready state.",
4378- LocalHTLCFailureReason::TemporaryChannelFailure ));
4378+ LocalHTLCFailureReason::ChannelNotReady ));
43794379 }
43804380 }
43814381 if next_packet.outgoing_amt_msat < chan.context.get_counterparty_htlc_minimum_msat() {
@@ -4416,7 +4416,7 @@ where
44164416 HopConnector::ShortChannelId(scid) => scid,
44174417 HopConnector::Trampoline(_) => {
44184418 return Err(("Cannot forward by Node ID without SCID.",
4419- LocalHTLCFailureReason::UnknownNextPeer ));
4419+ LocalHTLCFailureReason::InvalidTrampolineForward ));
44204420 }
44214421 };
44224422 match self.do_funded_channel_callback(outgoing_scid, |chan: &mut FundedChannel<SP>| {
@@ -8772,7 +8772,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
87728772 }
87738773 for htlc_source in dropped_htlcs.drain(..) {
87748774 let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id.clone()), channel_id: msg.channel_id };
8775- let reason = HTLCFailReason::from_failure_code(LocalHTLCFailureReason::PermanentChannelFailure );
8775+ let reason = HTLCFailReason::from_failure_code(LocalHTLCFailureReason::ChannelClosed );
87768776 self.fail_htlc_backwards_internal(&htlc_source.0, &htlc_source.1, &reason, receiver);
87778777 }
87788778 if let Some(shutdown_res) = finish_shutdown {
@@ -9628,7 +9628,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
96289628 );
96299629 } else {
96309630 log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
9631- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
9631+ let failure_reason = LocalHTLCFailureReason::OnChainTimeout ;
96329632 let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
96339633 let reason = HTLCFailReason::from_failure_code(failure_reason);
96349634 self.fail_htlc_backwards_internal(&htlc_update.source, &htlc_update.payment_hash, &reason, receiver);
@@ -11827,7 +11827,7 @@ where
1182711827 // number of blocks we generally consider it to take to do a commitment update,
1182811828 // just give up on it and fail the HTLC.
1182911829 if height >= htlc.cltv_expiry - HTLC_FAIL_BACK_BUFFER {
11830- let reason = LocalHTLCFailureReason::IncorrectPaymentDetails ;
11830+ let reason = LocalHTLCFailureReason::PaymentClaimBuffer ;
1183111831 timed_out_htlcs.push((HTLCSource::PreviousHopData(htlc.prev_hop.clone()), payment_hash.clone(),
1183211832 HTLCFailReason::reason(reason, invalid_payment_err_data(htlc.value, height)),
1183311833 HTLCDestination::FailedPayment { payment_hash: payment_hash.clone() }));
@@ -11858,7 +11858,7 @@ where
1185811858 _ => unreachable!(),
1185911859 };
1186011860 timed_out_htlcs.push((prev_hop_data, htlc.forward_info.payment_hash,
11861- HTLCFailReason::from_failure_code(LocalHTLCFailureReason::TemporaryNodeFailure ),
11861+ HTLCFailReason::from_failure_code(LocalHTLCFailureReason::ForwardExpiryBuffer ),
1186211862 HTLCDestination::InvalidForward { requested_forward_scid }));
1186311863 let logger = WithContext::from(
1186411864 &self.logger, None, Some(htlc.prev_channel_id), Some(htlc.forward_info.payment_hash)
@@ -14947,7 +14947,7 @@ where
1494714947
1494814948 for htlc_source in failed_htlcs.drain(..) {
1494914949 let (source, payment_hash, counterparty_node_id, channel_id) = htlc_source;
14950- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
14950+ let failure_reason = LocalHTLCFailureReason::ChannelClosed ;
1495114951 let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
1495214952 let reason = HTLCFailReason::from_failure_code(failure_reason);
1495314953 channel_manager.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
0 commit comments