Skip to content

Commit 49d5b65

Browse files
Support (de)serializing Path::blinded_tails in HTLCSource
1 parent 4ea2923 commit 49d5b65

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use crate::ln::features::{ChannelFeatures, ChannelTypeFeatures, InitFeatures, No
4545
#[cfg(any(feature = "_test_utils", test))]
4646
use crate::ln::features::InvoiceFeatures;
4747
use crate::routing::gossip::NetworkGraph;
48-
use crate::routing::router::{DefaultRouter, InFlightHtlcs, Path, PaymentParameters, Route, RouteHop, RouteParameters, Router};
48+
use crate::routing::router::{BlindedTail, DefaultRouter, InFlightHtlcs, Path, PaymentParameters, Route, RouteHop, RouteParameters, Router};
4949
use crate::routing::scoring::ProbabilisticScorer;
5050
use crate::ln::msgs;
5151
use crate::ln::onion_utils;
@@ -6877,19 +6877,21 @@ impl Readable for HTLCSource {
68776877
let mut path_hops: Option<Vec<RouteHop>> = Some(Vec::new());
68786878
let mut payment_id = None;
68796879
let mut payment_params: Option<PaymentParameters> = None;
6880+
let mut blinded_tail: Option<BlindedTail> = None;
68806881
read_tlv_fields!(reader, {
68816882
(0, session_priv, required),
68826883
(1, payment_id, option),
68836884
(2, first_hop_htlc_msat, required),
68846885
(4, path_hops, vec_type),
68856886
(5, payment_params, (option: ReadableArgs, 0)),
6887+
(6, blinded_tail, option),
68866888
});
68876889
if payment_id.is_none() {
68886890
// For backwards compat, if there was no payment_id written, use the session_priv bytes
68896891
// instead.
68906892
payment_id = Some(PaymentId(*session_priv.0.unwrap().as_ref()));
68916893
}
6892-
let path = Path { hops: path_hops.ok_or(DecodeError::InvalidValue)?, blinded_tail: None };
6894+
let path = Path { hops: path_hops.ok_or(DecodeError::InvalidValue)?, blinded_tail };
68936895
if path.hops.len() == 0 {
68946896
return Err(DecodeError::InvalidValue);
68956897
}
@@ -6924,6 +6926,7 @@ impl Writeable for HTLCSource {
69246926
// 3 was previously used to write a PaymentSecret for the payment.
69256927
(4, path.hops, vec_type),
69266928
(5, None::<PaymentParameters>, option), // payment_params in LDK versions prior to 0.0.115
6929+
(6, path.blinded_tail, option),
69276930
});
69286931
}
69296932
HTLCSource::PreviousHopData(ref field) => {

0 commit comments

Comments
 (0)