Skip to content

Commit 6fbeea0

Browse files
committed
Convert routing vec_type TLV writes to other TLV types
* `BlindedTail::hops` has always been written since it was introduced in 64c26c8. * `PaymentParameters::clear_hints` has always been written since it was introduced as `Payee::route_hitns` in 46b68c5.
1 parent 739ffe1 commit 6fbeea0

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lightning/src/routing/router.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub struct BlindedTail {
283283
}
284284

285285
impl_writeable_tlv_based!(BlindedTail, {
286-
(0, hops, vec_type),
286+
(0, hops, required_vec),
287287
(2, blinding_point, required),
288288
(4, excess_final_cltv_expiry_delta, required),
289289
(6, final_value_msat, required),
@@ -550,10 +550,10 @@ impl Writeable for PaymentParameters {
550550
(1, self.max_total_cltv_expiry_delta, required),
551551
(2, self.payee.features(), option),
552552
(3, self.max_path_count, required),
553-
(4, *clear_hints, vec_type),
553+
(4, *clear_hints, required_vec),
554554
(5, self.max_channel_saturation_power_of_half, required),
555555
(6, self.expiry_time, option),
556-
(7, self.previously_failed_channels, vec_type),
556+
(7, self.previously_failed_channels, required_vec),
557557
(8, *blinded_hints, optional_vec),
558558
(9, self.payee.final_cltv_expiry_delta(), option),
559559
});
@@ -568,14 +568,13 @@ impl ReadableArgs<u32> for PaymentParameters {
568568
(1, max_total_cltv_expiry_delta, (default_value, DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA)),
569569
(2, features, (option: ReadableArgs, payee_pubkey.is_some())),
570570
(3, max_path_count, (default_value, DEFAULT_MAX_PATH_COUNT)),
571-
(4, route_hints, vec_type),
571+
(4, clear_route_hints, required_vec),
572572
(5, max_channel_saturation_power_of_half, (default_value, DEFAULT_MAX_CHANNEL_SATURATION_POW_HALF)),
573573
(6, expiry_time, option),
574-
(7, previously_failed_channels, vec_type),
574+
(7, previously_failed_channels, optional_vec),
575575
(8, blinded_route_hints, optional_vec),
576576
(9, final_cltv_expiry_delta, (default_value, default_final_cltv_expiry_delta)),
577577
});
578-
let clear_route_hints = route_hints.unwrap_or(vec![]);
579578
let blinded_route_hints = blinded_route_hints.unwrap_or(vec![]);
580579
let payee = if blinded_route_hints.len() != 0 {
581580
if clear_route_hints.len() != 0 || payee_pubkey.is_some() { return Err(DecodeError::InvalidValue) }

0 commit comments

Comments
 (0)