@@ -3923,7 +3923,7 @@ where
3923
3923
}
3924
3924
3925
3925
for htlc_source in failed_htlcs.drain(..) {
3926
- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
3926
+ let failure_reason = LocalHTLCFailureReason::ChannelClosed ;
3927
3927
let reason = HTLCFailReason::from_failure_code(failure_reason);
3928
3928
let receiver = HTLCDestination::NextHopChannel { node_id: Some(*counterparty_node_id), channel_id: *channel_id };
3929
3929
self.fail_htlc_backwards_internal(&htlc_source.0, &htlc_source.1, &reason, receiver);
@@ -4047,7 +4047,7 @@ where
4047
4047
shutdown_res.closure_reason, shutdown_res.dropped_outbound_htlcs.len());
4048
4048
for htlc_source in shutdown_res.dropped_outbound_htlcs.drain(..) {
4049
4049
let (source, payment_hash, counterparty_node_id, channel_id) = htlc_source;
4050
- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
4050
+ let failure_reason = LocalHTLCFailureReason::ChannelClosed ;
4051
4051
let reason = HTLCFailReason::from_failure_code(failure_reason);
4052
4052
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
4053
4053
self.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
@@ -4350,19 +4350,19 @@ where
4350
4350
// should NOT reveal the existence or non-existence of a private channel if
4351
4351
// we don't allow forwards outbound over them.
4352
4352
return Err(("Refusing to forward to a private channel based on our config.",
4353
- LocalHTLCFailureReason::UnknownNextPeer ));
4353
+ LocalHTLCFailureReason::PrivateChannelForward ));
4354
4354
}
4355
4355
if let HopConnector::ShortChannelId(outgoing_scid) = next_packet.outgoing_connector {
4356
4356
if chan.funding.get_channel_type().supports_scid_privacy() && outgoing_scid != chan.context.outbound_scid_alias() {
4357
4357
// `option_scid_alias` (referred to in LDK as `scid_privacy`) means
4358
4358
// "refuse to forward unless the SCID alias was used", so we pretend
4359
4359
// we don't have the channel here.
4360
4360
return Err(("Refusing to forward over real channel SCID as our counterparty requested.",
4361
- LocalHTLCFailureReason::UnknownNextPeer ));
4361
+ LocalHTLCFailureReason::RealSCIDForward ));
4362
4362
}
4363
4363
} else {
4364
4364
return Err(("Cannot forward by Node ID without SCID.",
4365
- LocalHTLCFailureReason::UnknownNextPeer ));
4365
+ LocalHTLCFailureReason::InvalidTrampolineForward ));
4366
4366
}
4367
4367
4368
4368
// Note that we could technically not return an error yet here and just hope
@@ -4376,7 +4376,7 @@ where
4376
4376
LocalHTLCFailureReason::ChannelDisabled));
4377
4377
} else {
4378
4378
return Err(("Forwarding channel is not in a ready state.",
4379
- LocalHTLCFailureReason::TemporaryChannelFailure ));
4379
+ LocalHTLCFailureReason::ChannelNotReady ));
4380
4380
}
4381
4381
}
4382
4382
if next_packet.outgoing_amt_msat < chan.context.get_counterparty_htlc_minimum_msat() {
@@ -4417,7 +4417,7 @@ where
4417
4417
HopConnector::ShortChannelId(scid) => scid,
4418
4418
HopConnector::Trampoline(_) => {
4419
4419
return Err(("Cannot forward by Node ID without SCID.",
4420
- LocalHTLCFailureReason::UnknownNextPeer ));
4420
+ LocalHTLCFailureReason::InvalidTrampolineForward ));
4421
4421
}
4422
4422
};
4423
4423
match self.do_funded_channel_callback(outgoing_scid, |chan: &mut FundedChannel<SP>| {
@@ -8773,7 +8773,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
8773
8773
}
8774
8774
for htlc_source in dropped_htlcs.drain(..) {
8775
8775
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id.clone()), channel_id: msg.channel_id };
8776
- let reason = HTLCFailReason::from_failure_code(LocalHTLCFailureReason::PermanentChannelFailure );
8776
+ let reason = HTLCFailReason::from_failure_code(LocalHTLCFailureReason::ChannelClosed );
8777
8777
self.fail_htlc_backwards_internal(&htlc_source.0, &htlc_source.1, &reason, receiver);
8778
8778
}
8779
8779
if let Some(shutdown_res) = finish_shutdown {
@@ -9629,7 +9629,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
9629
9629
);
9630
9630
} else {
9631
9631
log_trace!(logger, "Failing HTLC with hash {} from our monitor", &htlc_update.payment_hash);
9632
- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
9632
+ let failure_reason = LocalHTLCFailureReason::OnChainTimeout ;
9633
9633
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
9634
9634
let reason = HTLCFailReason::from_failure_code(failure_reason);
9635
9635
self.fail_htlc_backwards_internal(&htlc_update.source, &htlc_update.payment_hash, &reason, receiver);
@@ -11828,7 +11828,7 @@ where
11828
11828
// number of blocks we generally consider it to take to do a commitment update,
11829
11829
// just give up on it and fail the HTLC.
11830
11830
if height >= htlc.cltv_expiry - HTLC_FAIL_BACK_BUFFER {
11831
- let reason = LocalHTLCFailureReason::IncorrectPaymentDetails ;
11831
+ let reason = LocalHTLCFailureReason::PaymentClaimBuffer ;
11832
11832
timed_out_htlcs.push((HTLCSource::PreviousHopData(htlc.prev_hop.clone()), payment_hash.clone(),
11833
11833
HTLCFailReason::reason(reason, invalid_payment_err_data(htlc.value, height)),
11834
11834
HTLCDestination::FailedPayment { payment_hash: payment_hash.clone() }));
@@ -11859,7 +11859,7 @@ where
11859
11859
_ => unreachable!(),
11860
11860
};
11861
11861
timed_out_htlcs.push((prev_hop_data, htlc.forward_info.payment_hash,
11862
- HTLCFailReason::from_failure_code(LocalHTLCFailureReason::TemporaryNodeFailure ),
11862
+ HTLCFailReason::from_failure_code(LocalHTLCFailureReason::ForwardExpiryBuffer ),
11863
11863
HTLCDestination::InvalidForward { requested_forward_scid }));
11864
11864
let logger = WithContext::from(
11865
11865
&self.logger, None, Some(htlc.prev_channel_id), Some(htlc.forward_info.payment_hash)
@@ -14948,7 +14948,7 @@ where
14948
14948
14949
14949
for htlc_source in failed_htlcs.drain(..) {
14950
14950
let (source, payment_hash, counterparty_node_id, channel_id) = htlc_source;
14951
- let failure_reason = LocalHTLCFailureReason::PermanentChannelFailure ;
14951
+ let failure_reason = LocalHTLCFailureReason::ChannelClosed ;
14952
14952
let receiver = HTLCDestination::NextHopChannel { node_id: Some(counterparty_node_id), channel_id };
14953
14953
let reason = HTLCFailReason::from_failure_code(failure_reason);
14954
14954
channel_manager.fail_htlc_backwards_internal(&source, &payment_hash, &reason, receiver);
0 commit comments