Skip to content

Commit 08b3658

Browse files
a-mpcharik-so
andcommitted
Expand HTLCDestination variants for Trampoline forwards
The previously existing `HTLCDestination` do not map nicely to the failure vent of a Trampoline forward, so we introduce a new variant to fill the gap. Co-authored-by: Arik Sosman <[email protected]>
1 parent 887aec9 commit 08b3658

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lightning/src/events/mod.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,14 @@ pub enum HTLCHandlingFailureType {
539539
/// Short channel id we are requesting to forward an HTLC to.
540540
requested_forward_scid: u64,
541541
},
542+
/// We couldn't forward to the next Trampoline node. That may happen if we cannot find a route,
543+
/// or if the route we found didn't work out.
544+
FailedTrampolineForward {
545+
/// The node ID of the next Trampoline hop we tried forwarding to.
546+
requested_next_node_id: PublicKey,
547+
/// The channel we tried forwarding over, if we have settled to one.
548+
forward_scid: Option<u64>,
549+
},
542550
/// We couldn't decode the incoming onion to obtain the forwarding details.
543551
InvalidOnion,
544552
/// Failure scenario where an HTLC may have been forwarded to be intended for us,
@@ -572,6 +580,10 @@ impl_writeable_tlv_based_enum_upgradable!(HTLCHandlingFailureType,
572580
(4, Receive) => {
573581
(0, payment_hash, required),
574582
},
583+
(5, FailedTrampolineForward) => {
584+
(0, requested_next_node_id, required),
585+
(2, forward_scid, option),
586+
}
575587
);
576588

577589
/// The reason for HTLC failures in [`Event::HTLCHandlingFailed`].

0 commit comments

Comments
 (0)