]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix fee_base_msat overflowing entire fee range in RouteHint
authorMatt Corallo <git@bluematt.me>
Wed, 15 Aug 2018 19:50:14 +0000 (15:50 -0400)
committerMatt Corallo <git@bluematt.me>
Fri, 17 Aug 2018 00:51:50 +0000 (20:51 -0400)
fuzz/fuzz_targets/router_target.rs
src/ln/router.rs

index f9c8d2ba23bf9f99ab9f500cc412a7f02c27fff3..759e41ff5033d737ed6c3871a4fc0ff67df49b5d 100644 (file)
@@ -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)),
index 5aaea4f67de130a8e64dcaf3a152d1ece433c741..665a24d2886ec5d8106333ef504ec565277c9348 100644 (file)
@@ -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,