Skip to content

Commit 33ed8fc

Browse files
committed
Send PaymentForwardedFailed if no forwardable HTLC
1 parent 97dcedb commit 33ed8fc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3982,7 +3982,7 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
39823982
pending_events.push(path_failure);
39833983
if let Some(ev) = full_failure_ev { pending_events.push(ev); }
39843984
},
3985-
HTLCSource::PreviousHopData(HTLCPreviousHopData { short_channel_id, htlc_id, incoming_packet_shared_secret, phantom_shared_secret, .. }) => {
3985+
HTLCSource::PreviousHopData(HTLCPreviousHopData { short_channel_id, htlc_id, incoming_packet_shared_secret, phantom_shared_secret, outpoint }) => {
39863986
let err_packet = match onion_error {
39873987
HTLCFailReason::Reason { failure_code, data } => {
39883988
log_trace!(self.logger, "Failing HTLC with payment_hash {} backwards from us with code {}", log_bytes!(payment_hash.0), failure_code);
@@ -4020,6 +4020,11 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
40204020
time_forwardable: time
40214021
});
40224022
}
4023+
4024+
let mut pending_events = self.pending_events.lock().unwrap();
4025+
pending_events.push(events::Event::PaymentForwardedFailed {
4026+
source_channel_id: outpoint.to_channel_id() , sink_node_id: self.get_our_node_id()
4027+
});
40234028
},
40244029
}
40254030
}

lightning/src/util/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ pub enum Event {
448448
/// Indicates that a payment has failed to be forwarded through us
449449
PaymentForwardedFailed {
450450
/// The channel_id of the sender
451-
source_channel_id: u64,
451+
source_channel_id: [u8; 32],
452452
/// The node_id of the receiver where forwarding has failed
453453
sink_node_id: PublicKey
454454
},

0 commit comments

Comments
 (0)