Skip to content

Commit b45de3b

Browse files
Support (de)serializing Path::blinded_tails in HTLCSource
1 parent 74e2add commit b45de3b

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;
@@ -7007,19 +7007,21 @@ impl Readable for HTLCSource {
70077007
let mut path_hops: Option<Vec<RouteHop>> = Some(Vec::new());
70087008
let mut payment_id = None;
70097009
let mut payment_params: Option<PaymentParameters> = None;
7010+
let mut blinded_tail: Option<BlindedTail> = None;
70107011
read_tlv_fields!(reader, {
70117012
(0, session_priv, required),
70127013
(1, payment_id, option),
70137014
(2, first_hop_htlc_msat, required),
70147015
(4, path_hops, vec_type),
70157016
(5, payment_params, (option: ReadableArgs, 0)),
7017+
(6, blinded_tail, option),
70167018
});
70177019
if payment_id.is_none() {
70187020
// For backwards compat, if there was no payment_id written, use the session_priv bytes
70197021
// instead.
70207022
payment_id = Some(PaymentId(*session_priv.0.unwrap().as_ref()));
70217023
}
7022-
let path = Path { hops: path_hops.ok_or(DecodeError::InvalidValue)?, blinded_tail: None };
7024+
let path = Path { hops: path_hops.ok_or(DecodeError::InvalidValue)?, blinded_tail };
70237025
if path.hops.len() == 0 {
70247026
return Err(DecodeError::InvalidValue);
70257027
}
@@ -7054,6 +7056,7 @@ impl Writeable for HTLCSource {
70547056
// 3 was previously used to write a PaymentSecret for the payment.
70557057
(4, path.hops, vec_type),
70567058
(5, None::<PaymentParameters>, option), // payment_params in LDK versions prior to 0.0.115
7059+
(6, path.blinded_tail, option),
70577060
});
70587061
}
70597062
HTLCSource::PreviousHopData(ref field) => {

0 commit comments

Comments
 (0)