From: Wilmer Paulino Date: Tue, 23 Jan 2024 00:29:41 +0000 (-0800) Subject: Add new HTLCDestination variant for invalid onion X-Git-Tag: v0.0.123-beta~21^2~9 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=e255b2301778e54852f3ccdd2d6415a189b64e50;p=rust-lightning 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. --- diff --git a/lightning/src/events/mod.rs b/lightning/src/events/mod.rs index f849dcc2f..b43f2f937 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), },