From dde0ac4c29d3b40a3f9ba7c297b3ff4df0cf703d Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 15 Aug 2018 15:50:14 -0400 Subject: [PATCH] Fix fee_base_msat overflowing entire fee range in RouteHint --- fuzz/fuzz_targets/router_target.rs | 2 +- src/ln/router.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fuzz/fuzz_targets/router_target.rs b/fuzz/fuzz_targets/router_target.rs index f9c8d2ba2..759e41ff5 100644 --- a/fuzz/fuzz_targets/router_target.rs +++ b/fuzz/fuzz_targets/router_target.rs @@ -165,7 +165,7 @@ pub fn do_test(data: &[u8]) { last_hops_vec.push(RouteHint { src_node_id: get_pubkey!(), short_channel_id: slice_to_be64(get_slice!(8)), - fee_base_msat: slice_to_be64(get_slice!(8)), + fee_base_msat: slice_to_be32(get_slice!(4)), fee_proportional_millionths: slice_to_be32(get_slice!(4)), cltv_expiry_delta: slice_to_be16(get_slice!(2)), htlc_minimum_msat: slice_to_be64(get_slice!(8)), diff --git a/src/ln/router.rs b/src/ln/router.rs index 5aaea4f67..665a24d28 100644 --- a/src/ln/router.rs +++ b/src/ln/router.rs @@ -95,7 +95,7 @@ impl NetworkMap { pub struct RouteHint { pub src_node_id: PublicKey, pub short_channel_id: u64, - pub fee_base_msat: u64, + pub fee_base_msat: u32, pub fee_proportional_millionths: u32, pub cltv_expiry_delta: u16, pub htlc_minimum_msat: u64, -- 2.39.5