Fix `Route` serialization round-trip
authorMatt Corallo <git@bluematt.me>
Fri, 16 Feb 2024 19:26:22 +0000 (19:26 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 9 Apr 2024 15:01:41 +0000 (15:01 +0000)
commit72c4eb83d82cb26d2c16023febb5373b1ae27caf
tree01c5d6abba36b3df6b631c51f78ec86399a89d1e
parentd429065d2d01594fc6f38e41028a29bad1fd7c73
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