Move outbound channel constructor into `OutboundV1Channel` impl
[rust-lightning] / fuzz / src / chanmon_consistency.rs
index bb4066700639680485e0c6fea1957cf020992ee4..309faaa95522f0773080cd9a82bd0aa822f6165b 100644 (file)
@@ -296,13 +296,8 @@ fn check_api_err(api_err: APIError, sendable_bounds_violated: bool) {
                        // is probably just stale and you should add new messages here.
                        match err.as_str() {
                                "Peer for first hop currently disconnected" => {},
-                               _ if err.starts_with("Cannot push more than their max accepted HTLCs ") => {},
-                               _ if err.starts_with("Cannot send value that would put us over the max HTLC value in flight our peer will accept ") => {},
-                               _ if err.starts_with("Cannot send value that would put our balance under counterparty-announced channel reserve value") => {},
-                               _ if err.starts_with("Cannot send value that would put counterparty balance under holder-announced channel reserve value") => {},
-                               _ if err.starts_with("Cannot send value that would overdraw remaining funds.") => {},
-                               _ if err.starts_with("Cannot send value that would not leave enough to pay for fees.") => {},
-                               _ if err.starts_with("Cannot send value that would put our exposure to dust HTLCs at") => {},
+                               _ if err.starts_with("Cannot send less than our next-HTLC minimum - ") => {},
+                               _ if err.starts_with("Cannot send more than our next-HTLC maximum - ") => {},
                                _ => panic!("{}", err),
                        }
                        assert!(sendable_bounds_violated);
@@ -499,8 +494,12 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
        let mut channel_txn = Vec::new();
        macro_rules! make_channel {
                ($source: expr, $dest: expr, $chan_id: expr) => { {
-                       $source.peer_connected(&$dest.get_our_node_id(), &Init { features: $dest.init_features(), remote_network_address: None }, true).unwrap();
-                       $dest.peer_connected(&$source.get_our_node_id(), &Init { features: $source.init_features(), remote_network_address: None }, false).unwrap();
+                       $source.peer_connected(&$dest.get_our_node_id(), &Init {
+                               features: $dest.init_features(), networks: None, remote_network_address: None
+                       }, true).unwrap();
+                       $dest.peer_connected(&$source.get_our_node_id(), &Init {
+                               features: $source.init_features(), networks: None, remote_network_address: None
+                       }, false).unwrap();
 
                        $source.create_channel($dest.get_our_node_id(), 100_000, 42, 0, None).unwrap();
                        let open_channel = {
@@ -1031,15 +1030,23 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
                        },
                        0x0e => {
                                if chan_a_disconnected {
-                                       nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, true).unwrap();
-                                       nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init { features: nodes[0].init_features(), remote_network_address: None }, false).unwrap();
+                                       nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init {
+                                               features: nodes[1].init_features(), networks: None, remote_network_address: None
+                                       }, true).unwrap();
+                                       nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init {
+                                               features: nodes[0].init_features(), networks: None, remote_network_address: None
+                                       }, false).unwrap();
                                        chan_a_disconnected = false;
                                }
                        },
                        0x0f => {
                                if chan_b_disconnected {
-                                       nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init { features: nodes[2].init_features(), remote_network_address: None }, true).unwrap();
-                                       nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, false).unwrap();
+                                       nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init {
+                                               features: nodes[2].init_features(), networks: None, remote_network_address: None
+                                       }, true).unwrap();
+                                       nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init {
+                                               features: nodes[1].init_features(), networks: None, remote_network_address: None
+                                       }, false).unwrap();
                                        chan_b_disconnected = false;
                                }
                        },
@@ -1234,13 +1241,21 @@ pub fn do_test<Out: Output>(data: &[u8], underlying_out: Out) {
 
                                // Next, make sure peers are all connected to each other
                                if chan_a_disconnected {
-                                       nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, true).unwrap();
-                                       nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init { features: nodes[0].init_features(), remote_network_address: None }, false).unwrap();
+                                       nodes[0].peer_connected(&nodes[1].get_our_node_id(), &Init {
+                                               features: nodes[1].init_features(), networks: None, remote_network_address: None
+                                       }, true).unwrap();
+                                       nodes[1].peer_connected(&nodes[0].get_our_node_id(), &Init {
+                                               features: nodes[0].init_features(), networks: None, remote_network_address: None
+                                       }, false).unwrap();
                                        chan_a_disconnected = false;
                                }
                                if chan_b_disconnected {
-                                       nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init { features: nodes[2].init_features(), remote_network_address: None }, true).unwrap();
-                                       nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init { features: nodes[1].init_features(), remote_network_address: None }, false).unwrap();
+                                       nodes[1].peer_connected(&nodes[2].get_our_node_id(), &Init {
+                                               features: nodes[2].init_features(), networks: None, remote_network_address: None
+                                       }, true).unwrap();
+                                       nodes[2].peer_connected(&nodes[1].get_our_node_id(), &Init {
+                                               features: nodes[1].init_features(), networks: None, remote_network_address: None
+                                       }, false).unwrap();
                                        chan_b_disconnected = false;
                                }