Skip to content

Commit db54cb8

Browse files
committed
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.
1 parent a769cba commit db54cb8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lightning/src/events/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ pub enum HTLCDestination {
298298
/// Short channel id we are requesting to forward an HTLC to.
299299
requested_forward_scid: u64
300300
},
301+
/// We couldn't decode the incoming onion to obtain the forwarding details.
302+
InvalidOnion,
301303
/// Failure scenario where an HTLC may have been forwarded to be intended for us,
302304
/// but is invalid for some reason, so we reject it.
303305
///
@@ -325,6 +327,7 @@ impl_writeable_tlv_based_enum_upgradable!(HTLCDestination,
325327
(2, UnknownNextHop) => {
326328
(0, requested_forward_scid, required),
327329
},
330+
(3, InvalidOnion) => {},
328331
(4, FailedPayment) => {
329332
(0, payment_hash, required),
330333
},

0 commit comments

Comments
 (0)