From 1036549e2c28975d3d1955a24334b3e7d3108aab Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 16 Feb 2024 19:26:22 +0000 Subject: [PATCH] Fix `Route` serialization round-trip When the `max_total_routing_fee_msat` parameter was added to `RouteParameters`, the serialization used `map` to get the max fee, accidentally writing an `Option>`, but then read it as an `Option`. Thus, any `Route`s with a `route_params` written will fail to be read back. Luckily, this is an incredibly rarely-used bit of code, so only one user managed to hit it. --- lightning/src/routing/router.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightning/src/routing/router.rs b/lightning/src/routing/router.rs index 3402907a8..a4a32d1cb 100644 --- a/lightning/src/routing/router.rs +++ b/lightning/src/routing/router.rs @@ -523,7 +523,7 @@ impl Writeable for Route { (1, self.route_params.as_ref().map(|p| &p.payment_params), option), (2, blinded_tails, optional_vec), (3, self.route_params.as_ref().map(|p| p.final_value_msat), option), - (5, self.route_params.as_ref().map(|p| p.max_total_routing_fee_msat), option), + (5, self.route_params.as_ref().and_then(|p| p.max_total_routing_fee_msat), option), }); Ok(()) } -- 2.39.5