Skip to content

Commit 72c4eb8

Browse files
committed
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<Option<u64>>`, but then read it as an `Option<u64>`. 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.
1 parent d429065 commit 72c4eb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/routing/router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ impl Writeable for Route {
529529
(1, self.route_params.as_ref().map(|p| &p.payment_params), option),
530530
(2, blinded_tails, optional_vec),
531531
(3, self.route_params.as_ref().map(|p| p.final_value_msat), option),
532-
(5, self.route_params.as_ref().map(|p| p.max_total_routing_fee_msat), option),
532+
(5, self.route_params.as_ref().and_then(|p| p.max_total_routing_fee_msat), option),
533533
});
534534
Ok(())
535535
}

0 commit comments

Comments
 (0)