]> git.bitcoin.ninja Git - rust-lightning/commit
Fix `Route` serialization round-trip 2024-02-fix-route-ser-118-bindings
authorMatt Corallo <git@bluematt.me>
Fri, 16 Feb 2024 19:26:22 +0000 (19:26 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 16 Feb 2024 19:54:21 +0000 (19:54 +0000)
commit8ad35c5d177918ca5c6693a2da617e8377128a25
tree829abb23aba12d013da8c746d138f07dd5cbb62c
parenta2a2374cccb34420838746a6e17607d2bbef3fa8
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.
lightning/src/routing/router.rs