From e255b2301778e54852f3ccdd2d6415a189b64e50 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Mon, 22 Jan 2024 16:29:41 -0800 Subject: [PATCH] Add new HTLCDestination variant for invalid onion The existing variants do not cover such case as we previously never surfaced `HTLCHandlingFailed` events for HTLCs that we failed back with `UpdateFailMalformedHTLC` due to an invalid onion packet. --- lightning/src/events/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lightning/src/events/mod.rs b/lightning/src/events/mod.rs index f849dcc2..b43f2f93 100644 --- a/lightning/src/events/mod.rs +++ b/lightning/src/events/mod.rs @@ -302,6 +302,8 @@ pub enum HTLCDestination { /// Short channel id we are requesting to forward an HTLC to. requested_forward_scid: u64 }, + /// We couldn't decode the incoming onion to obtain the forwarding details. + InvalidOnion, /// Failure scenario where an HTLC may have been forwarded to be intended for us, /// but is invalid for some reason, so we reject it. /// @@ -329,6 +331,7 @@ impl_writeable_tlv_based_enum_upgradable!(HTLCDestination, (2, UnknownNextHop) => { (0, requested_forward_scid, required), }, + (3, InvalidOnion) => {}, (4, FailedPayment) => { (0, payment_hash, required), }, -- 2.30.2