Skip to content

Commit e255b23

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 0b38b39 commit e255b23

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
@@ -302,6 +302,8 @@ pub enum HTLCDestination {
302302
/// Short channel id we are requesting to forward an HTLC to.
303303
requested_forward_scid: u64
304304
},
305+
/// We couldn't decode the incoming onion to obtain the forwarding details.
306+
InvalidOnion,
305307
/// Failure scenario where an HTLC may have been forwarded to be intended for us,
306308
/// but is invalid for some reason, so we reject it.
307309
///
@@ -329,6 +331,7 @@ impl_writeable_tlv_based_enum_upgradable!(HTLCDestination,
329331
(2, UnknownNextHop) => {
330332
(0, requested_forward_scid, required),
331333
},
334+
(3, InvalidOnion) => {},
332335
(4, FailedPayment) => {
333336
(0, payment_hash, required),
334337
},

0 commit comments

Comments
 (0)