Skip to content

Commit 6411c95

Browse files
committed
f: serialize trampoline hops in event
1 parent 6b8ff45 commit 6411c95

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lightning/src/events/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::types::payment::{PaymentPreimage, PaymentHash, PaymentSecret};
3030
use crate::offers::invoice::Bolt12Invoice;
3131
use crate::onion_message::messenger::Responder;
3232
use crate::routing::gossip::NetworkUpdate;
33-
use crate::routing::router::{BlindedTail, Path, RouteHop, RouteParameters};
33+
use crate::routing::router::{BlindedTail, Path, RouteHop, RouteParameters, TrampolineHop};
3434
use crate::sign::SpendableOutputDescriptor;
3535
use crate::util::errors::APIError;
3636
use crate::util::ser::{BigSize, FixedLengthReader, Writeable, Writer, MaybeReadable, Readable, RequiredWrapper, UpgradableRequired, WithoutLength};
@@ -1185,12 +1185,12 @@ pub enum Event {
11851185
/// events generated or serialized by versions prior to 0.0.122.
11861186
next_user_channel_id: Option<u128>,
11871187
/// The node id of the previous node.
1188-
///
1188+
///
11891189
/// This is only `None` for HTLCs received prior to 0.1 or for events serialized by
11901190
/// versions prior to 0.1
11911191
prev_node_id: Option<PublicKey>,
11921192
/// The node id of the next node.
1193-
///
1193+
///
11941194
/// This is only `None` for HTLCs received prior to 0.1 or for events serialized by
11951195
/// versions prior to 0.1
11961196
next_node_id: Option<PublicKey>,
@@ -1584,6 +1584,7 @@ impl Writeable for Event {
15841584
(9, None::<RouteParameters>, option), // retry in LDK versions prior to 0.0.115
15851585
(11, payment_id, option),
15861586
(13, failure, required),
1587+
(15, path.trampoline_hops, required_vec),
15871588
});
15881589
},
15891590
&Event::PendingHTLCsForwardable { time_forwardable: _ } => {
@@ -1919,6 +1920,7 @@ impl MaybeReadable for Event {
19191920
let mut network_update = None;
19201921
let mut blinded_tail: Option<BlindedTail> = None;
19211922
let mut path: Option<Vec<RouteHop>> = Some(vec![]);
1923+
let mut trampoline_path: Option<Vec<TrampolineHop>> = Some(vec![]);
19221924
let mut short_channel_id = None;
19231925
let mut payment_id = None;
19241926
let mut failure_opt = None;
@@ -1933,14 +1935,15 @@ impl MaybeReadable for Event {
19331935
(7, short_channel_id, option),
19341936
(11, payment_id, option),
19351937
(13, failure_opt, upgradable_option),
1938+
(15, trampoline_path, optional_vec),
19361939
});
19371940
let failure = failure_opt.unwrap_or_else(|| PathFailure::OnPath { network_update });
19381941
Ok(Some(Event::PaymentPathFailed {
19391942
payment_id,
19401943
payment_hash,
19411944
payment_failed_permanently,
19421945
failure,
1943-
path: Path { hops: path.unwrap(), trampoline_hops: vec![], blinded_tail },
1946+
path: Path { hops: path.unwrap(), trampoline_hops: trampoline_path.unwrap_or(vec![]), blinded_tail },
19441947
short_channel_id,
19451948
#[cfg(test)]
19461949
error_code,

0 commit comments

Comments
 (0)