From: Matt Corallo Date: Fri, 7 Jul 2023 19:27:15 +0000 (+0000) Subject: Convert routing `vec_type `TLV writes to other TLV types X-Git-Tag: v0.0.116-rc1~7^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=6fbeea02ed9fa1690b1cd3f5da4c5678bab2d720;p=rust-lightning Convert routing `vec_type `TLV writes to other TLV types * `BlindedTail::hops` has always been written since it was introduced in 64c26c8a793f35c55076a2188912e92106900bab. * `PaymentParameters::clear_hints` has always been written since it was introduced as `Payee::route_hitns` in 46b68c517dba57bde5. --- diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index ed5b772e..8c00df99 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -283,7 +283,7 @@ pub struct BlindedTail { } impl_writeable_tlv_based!(BlindedTail, { - (0, hops, vec_type), + (0, hops, required_vec), (2, blinding_point, required), (4, excess_final_cltv_expiry_delta, required), (6, final_value_msat, required), @@ -550,10 +550,10 @@ impl Writeable for PaymentParameters { (1, self.max_total_cltv_expiry_delta, required), (2, self.payee.features(), option), (3, self.max_path_count, required), - (4, *clear_hints, vec_type), + (4, *clear_hints, required_vec), (5, self.max_channel_saturation_power_of_half, required), (6, self.expiry_time, option), - (7, self.previously_failed_channels, vec_type), + (7, self.previously_failed_channels, required_vec), (8, *blinded_hints, optional_vec), (9, self.payee.final_cltv_expiry_delta(), option), }); @@ -568,14 +568,13 @@ impl ReadableArgs for PaymentParameters { (1, max_total_cltv_expiry_delta, (default_value, DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA)), (2, features, (option: ReadableArgs, payee_pubkey.is_some())), (3, max_path_count, (default_value, DEFAULT_MAX_PATH_COUNT)), - (4, route_hints, vec_type), + (4, clear_route_hints, required_vec), (5, max_channel_saturation_power_of_half, (default_value, DEFAULT_MAX_CHANNEL_SATURATION_POW_HALF)), (6, expiry_time, option), - (7, previously_failed_channels, vec_type), + (7, previously_failed_channels, optional_vec), (8, blinded_route_hints, optional_vec), (9, final_cltv_expiry_delta, (default_value, default_final_cltv_expiry_delta)), }); - let clear_route_hints = route_hints.unwrap_or(vec![]); let blinded_route_hints = blinded_route_hints.unwrap_or(vec![]); let payee = if blinded_route_hints.len() != 0 { if clear_route_hints.len() != 0 || payee_pubkey.is_some() { return Err(DecodeError::InvalidValue) }