From: Matt Corallo Date: Wed, 15 Aug 2018 19:50:14 +0000 (-0400) Subject: Fix fee_base_msat overflowing entire fee range in RouteHint X-Git-Tag: v0.0.12~351^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=dde0ac4c29d3b40a3f9ba7c297b3ff4df0cf703d;p=rust-lightning Fix fee_base_msat overflowing entire fee range in RouteHint --- 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,