@@ -50,7 +50,7 @@ use crate::ln::chan_utils::{
50
50
#[cfg(splicing)]
51
51
use crate::ln::chan_utils::FUNDING_TRANSACTION_WITNESS_WEIGHT;
52
52
use crate::ln::chan_utils;
53
- use crate::ln::onion_utils::{HTLCFailReason , LocalHTLCFailureReason, AttributionData};
53
+ use crate::ln::onion_utils::{HTLCFailurePayload , LocalHTLCFailureReason, AttributionData};
54
54
use crate::chain::BestBlock;
55
55
use crate::chain::chaininterface::{FeeEstimator, ConfirmationTarget, LowerBoundedFeeEstimator, fee_for_weight};
56
56
use crate::chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateStep, LATENCY_GRACE_PERIOD_BLOCKS};
@@ -380,11 +380,11 @@ enum OutboundHTLCOutcome {
380
380
/// We started always filling in the preimages here in 0.0.105, and the requirement
381
381
/// that the preimages always be filled in was added in 0.2.
382
382
Success(PaymentPreimage),
383
- Failure(HTLCFailReason ),
383
+ Failure(HTLCFailurePayload ),
384
384
}
385
385
386
- impl<'a> Into<Option<&'a HTLCFailReason >> for &'a OutboundHTLCOutcome {
387
- fn into(self) -> Option<&'a HTLCFailReason > {
386
+ impl<'a> Into<Option<&'a HTLCFailurePayload >> for &'a OutboundHTLCOutcome {
387
+ fn into(self) -> Option<&'a HTLCFailurePayload > {
388
388
match self {
389
389
OutboundHTLCOutcome::Success(_) => None,
390
390
OutboundHTLCOutcome::Failure(ref r) => Some(r)
@@ -1042,7 +1042,7 @@ pub(super) struct MonitorRestoreUpdates {
1042
1042
pub commitment_update: Option<msgs::CommitmentUpdate>,
1043
1043
pub order: RAACommitmentOrder,
1044
1044
pub accepted_htlcs: Vec<(PendingHTLCInfo, u64)>,
1045
- pub failed_htlcs: Vec<(HTLCSource, PaymentHash, HTLCFailReason )>,
1045
+ pub failed_htlcs: Vec<(HTLCSource, PaymentHash, HTLCFailurePayload )>,
1046
1046
pub finalized_claimed_htlcs: Vec<HTLCSource>,
1047
1047
pub pending_update_adds: Vec<msgs::UpdateAddHTLC>,
1048
1048
pub funding_broadcastable: Option<Transaction>,
@@ -1971,7 +1971,7 @@ pub(super) struct ChannelContext<SP: Deref> where SP::Target: SignerProvider {
1971
1971
// completed or not. We currently ignore these fields entirely when force-closing a channel,
1972
1972
// but need to handle this somehow or we run the risk of losing HTLCs!
1973
1973
monitor_pending_forwards: Vec<(PendingHTLCInfo, u64)>,
1974
- monitor_pending_failures: Vec<(HTLCSource, PaymentHash, HTLCFailReason )>,
1974
+ monitor_pending_failures: Vec<(HTLCSource, PaymentHash, HTLCFailurePayload )>,
1975
1975
monitor_pending_finalized_fulfills: Vec<HTLCSource>,
1976
1976
monitor_pending_update_adds: Vec<msgs::UpdateAddHTLC>,
1977
1977
monitor_pending_tx_signatures: Option<msgs::TxSignatures>,
@@ -5828,7 +5828,7 @@ impl<SP: Deref> FundedChannel<SP> where
5828
5828
self.mark_outbound_htlc_removed(msg.htlc_id, OutboundHTLCOutcome::Success(msg.payment_preimage)).map(|htlc| (htlc.source.clone(), htlc.amount_msat, htlc.skimmed_fee_msat))
5829
5829
}
5830
5830
5831
- pub fn update_fail_htlc(&mut self, msg: &msgs::UpdateFailHTLC, fail_reason: HTLCFailReason ) -> Result<(), ChannelError> {
5831
+ pub fn update_fail_htlc(&mut self, msg: &msgs::UpdateFailHTLC, fail_reason: HTLCFailurePayload ) -> Result<(), ChannelError> {
5832
5832
if self.context.channel_state.is_remote_stfu_sent() || self.context.channel_state.is_quiescent() {
5833
5833
return Err(ChannelError::WarnAndDisconnect("Got fail HTLC message while quiescent".to_owned()));
5834
5834
}
@@ -5843,7 +5843,7 @@ impl<SP: Deref> FundedChannel<SP> where
5843
5843
Ok(())
5844
5844
}
5845
5845
5846
- pub fn update_fail_malformed_htlc(&mut self, msg: &msgs::UpdateFailMalformedHTLC, fail_reason: HTLCFailReason ) -> Result<(), ChannelError> {
5846
+ pub fn update_fail_malformed_htlc(&mut self, msg: &msgs::UpdateFailMalformedHTLC, fail_reason: HTLCFailurePayload ) -> Result<(), ChannelError> {
5847
5847
if self.context.channel_state.is_remote_stfu_sent() || self.context.channel_state.is_quiescent() {
5848
5848
return Err(ChannelError::WarnAndDisconnect("Got fail malformed HTLC message while quiescent".to_owned()));
5849
5849
}
@@ -6000,7 +6000,7 @@ impl<SP: Deref> FundedChannel<SP> where
6000
6000
if let &mut OutboundHTLCState::RemoteRemoved(ref mut outcome) = &mut htlc.state {
6001
6001
log_trace!(logger, "Updating HTLC {} to AwaitingRemoteRevokeToRemove due to commitment_signed in channel {}.",
6002
6002
&htlc.payment_hash, &self.context.channel_id);
6003
- // Swap against a dummy variant to avoid a potentially expensive clone of `OutboundHTLCOutcome::Failure(HTLCFailReason )`
6003
+ // Swap against a dummy variant to avoid a potentially expensive clone of `OutboundHTLCOutcome::Failure(HTLCFailurePayload )`
6004
6004
let mut reason = OutboundHTLCOutcome::Success(PaymentPreimage([0u8; 32]));
6005
6005
mem::swap(outcome, &mut reason);
6006
6006
if let OutboundHTLCOutcome::Success(preimage) = reason {
@@ -6413,7 +6413,7 @@ impl<SP: Deref> FundedChannel<SP> where
6413
6413
}
6414
6414
if let &mut OutboundHTLCState::AwaitingRemoteRevokeToRemove(ref mut outcome) = &mut htlc.state {
6415
6415
log_trace!(logger, " ...promoting outbound AwaitingRemoteRevokeToRemove {} to AwaitingRemovedRemoteRevoke", &htlc.payment_hash);
6416
- // Swap against a dummy variant to avoid a potentially expensive clone of `OutboundHTLCOutcome::Failure(HTLCFailReason )`
6416
+ // Swap against a dummy variant to avoid a potentially expensive clone of `OutboundHTLCOutcome::Failure(HTLCFailurePayload )`
6417
6417
let mut reason = OutboundHTLCOutcome::Success(PaymentPreimage([0u8; 32]));
6418
6418
mem::swap(outcome, &mut reason);
6419
6419
htlc.state = OutboundHTLCState::AwaitingRemovedRemoteRevoke(reason);
@@ -6768,7 +6768,7 @@ impl<SP: Deref> FundedChannel<SP> where
6768
6768
/// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
6769
6769
fn monitor_updating_paused(&mut self, resend_raa: bool, resend_commitment: bool,
6770
6770
resend_channel_ready: bool, mut pending_forwards: Vec<(PendingHTLCInfo, u64)>,
6771
- mut pending_fails: Vec<(HTLCSource, PaymentHash, HTLCFailReason )>,
6771
+ mut pending_fails: Vec<(HTLCSource, PaymentHash, HTLCFailurePayload )>,
6772
6772
mut pending_finalized_claimed_htlcs: Vec<HTLCSource>
6773
6773
) {
6774
6774
self.context.monitor_pending_revoke_and_ack |= resend_raa;
@@ -8987,7 +8987,7 @@ impl<SP: Deref> FundedChannel<SP> where
8987
8987
for htlc in self.context.pending_outbound_htlcs.iter_mut() {
8988
8988
if let &mut OutboundHTLCState::AwaitingRemoteRevokeToRemove(ref mut outcome) = &mut htlc.state {
8989
8989
log_trace!(logger, " ...promoting outbound AwaitingRemoteRevokeToRemove {} to AwaitingRemovedRemoteRevoke", &htlc.payment_hash);
8990
- // Swap against a dummy variant to avoid a potentially expensive clone of `OutboundHTLCOutcome::Failure(HTLCFailReason )`
8990
+ // Swap against a dummy variant to avoid a potentially expensive clone of `OutboundHTLCOutcome::Failure(HTLCFailurePayload )`
8991
8991
let mut reason = OutboundHTLCOutcome::Success(PaymentPreimage([0u8; 32]));
8992
8992
mem::swap(outcome, &mut reason);
8993
8993
htlc.state = OutboundHTLCState::AwaitingRemovedRemoteRevoke(reason);
@@ -10644,15 +10644,15 @@ impl<SP: Deref> Writeable for FundedChannel<SP> where SP::Target: SignerProvider
10644
10644
if let OutboundHTLCOutcome::Success(preimage) = outcome {
10645
10645
preimages.push(Some(preimage));
10646
10646
}
10647
- let reason: Option<&HTLCFailReason > = outcome.into();
10647
+ let reason: Option<&HTLCFailurePayload > = outcome.into();
10648
10648
reason.write(writer)?;
10649
10649
}
10650
10650
&OutboundHTLCState::AwaitingRemovedRemoteRevoke(ref outcome) => {
10651
10651
4u8.write(writer)?;
10652
10652
if let OutboundHTLCOutcome::Success(preimage) = outcome {
10653
10653
preimages.push(Some(preimage));
10654
10654
}
10655
- let reason: Option<&HTLCFailReason > = outcome.into();
10655
+ let reason: Option<&HTLCFailurePayload > = outcome.into();
10656
10656
reason.write(writer)?;
10657
10657
}
10658
10658
}
@@ -10988,7 +10988,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
10988
10988
0 => OutboundHTLCState::LocalAnnounced(Box::new(Readable::read(reader)?)),
10989
10989
1 => OutboundHTLCState::Committed,
10990
10990
2 => {
10991
- let option: Option<HTLCFailReason > = Readable::read(reader)?;
10991
+ let option: Option<HTLCFailurePayload > = Readable::read(reader)?;
10992
10992
let outcome = match option {
10993
10993
Some(r) => OutboundHTLCOutcome::Failure(r),
10994
10994
// Initialize this variant with a dummy preimage, the actual preimage will be filled in further down
@@ -10997,7 +10997,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
10997
10997
OutboundHTLCState::RemoteRemoved(outcome)
10998
10998
},
10999
10999
3 => {
11000
- let option: Option<HTLCFailReason > = Readable::read(reader)?;
11000
+ let option: Option<HTLCFailurePayload > = Readable::read(reader)?;
11001
11001
let outcome = match option {
11002
11002
Some(r) => OutboundHTLCOutcome::Failure(r),
11003
11003
// Initialize this variant with a dummy preimage, the actual preimage will be filled in further down
@@ -11006,7 +11006,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, &'c Channel
11006
11006
OutboundHTLCState::AwaitingRemoteRevokeToRemove(outcome)
11007
11007
},
11008
11008
4 => {
11009
- let option: Option<HTLCFailReason > = Readable::read(reader)?;
11009
+ let option: Option<HTLCFailurePayload > = Readable::read(reader)?;
11010
11010
let outcome = match option {
11011
11011
Some(r) => OutboundHTLCOutcome::Failure(r),
11012
11012
// Initialize this variant with a dummy preimage, the actual preimage will be filled in further down
0 commit comments