Relicense as dual Apache-2.0 + MIT
[rust-lightning] / fuzz / src / full_stack.rs
index 726700ad2ee0d2efbda750d4ced1add4f433cd9e..51e399412cb140562002277ab4653739a12f3427 100644 (file)
@@ -1,3 +1,12 @@
+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
+// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
 //! Test that no series of bytes received over the wire/connections created/payments sent can
 //! result in a crash. We do this by standing up a node and then reading bytes from input to denote
 //! actions such as creating new inbound/outbound connections, bytes to be read from a connection,
@@ -183,7 +192,7 @@ impl<'a> MoneyLossDetector<'a> {
                                hash_map::Entry::Vacant(e) => {
                                        e.insert(self.height);
                                        txn.push(tx);
-                                       txn_idxs.push(idx as u32 + 1);
+                                       txn_idxs.push(idx + 1);
                                },
                                _ => {},
                        }
@@ -400,7 +409,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
                        },
                        4 => {
                                let value = slice_to_be24(get_slice!(3)) as u64;
-                               let route = match get_route(&our_id, &net_graph_msg_handler, &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
+                               let route = match get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
                                        Ok(route) => route,
                                        Err(_) => return,
                                };
@@ -417,7 +426,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
                        },
                        15 => {
                                let value = slice_to_be24(get_slice!(3)) as u64;
-                               let mut route = match get_route(&our_id, &net_graph_msg_handler, &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
+                               let mut route = match get_route(&our_id, &net_graph_msg_handler.network_graph.read().unwrap(), &get_pubkey!(), None, &Vec::new(), value, 42, Arc::clone(&logger)) {
                                        Ok(route) => route,
                                        Err(_) => return,
                                };