]> git.bitcoin.ninja Git - rust-lightning/blobdiff - lightning/src/ln/router.rs
Move features into a separate module out of msgs.
[rust-lightning] / lightning / src / ln / router.rs
index 5a21055cab6d5e4d1d3edb7f5192a19b08fc35c2..536ec55d73ff4d9ff5fd5c9142d42aed2c5f5b0b 100644 (file)
@@ -14,7 +14,8 @@ use bitcoin::blockdata::opcodes;
 
 use chain::chaininterface::{ChainError, ChainWatchInterface};
 use ln::channelmanager;
-use ln::msgs::{DecodeError,ErrorAction,LightningError,RoutingMessageHandler,NetAddress,ChannelFeatures,NodeFeatures};
+use ln::features::{ChannelFeatures, NodeFeatures};
+use ln::msgs::{DecodeError,ErrorAction,LightningError,RoutingMessageHandler,NetAddress};
 use ln::msgs;
 use util::ser::{Writeable, Readable, Writer, ReadableArgs};
 use util::logger::Logger;
@@ -538,7 +539,7 @@ impl RoutingMessageHandler for Router {
                                                        channels: vec!(NetworkMap::get_key(msg.contents.short_channel_id, msg.contents.chain_hash)),
                                                        lowest_inbound_channel_fee_base_msat: u32::max_value(),
                                                        lowest_inbound_channel_fee_proportional_millionths: u32::max_value(),
-                                                       features: NodeFeatures::new(),
+                                                       features: NodeFeatures::empty(),
                                                        last_update: 0,
                                                        rgb: [0; 3],
                                                        alias: [0; 32],
@@ -740,7 +741,7 @@ impl Router {
                        channels: Vec::new(),
                        lowest_inbound_channel_fee_base_msat: u32::max_value(),
                        lowest_inbound_channel_fee_proportional_millionths: u32::max_value(),
-                       features: NodeFeatures::new(),
+                       features: NodeFeatures::empty(),
                        last_update: 0,
                        rgb: [0; 3],
                        alias: [0; 32],
@@ -1011,7 +1012,8 @@ mod tests {
        use chain::chaininterface;
        use ln::channelmanager;
        use ln::router::{Router,NodeInfo,NetworkMap,ChannelInfo,DirectionalChannelInfo,RouteHint};
-       use ln::msgs::{ChannelFeatures, NodeFeatures, LightningError, ErrorAction};
+       use ln::features::{ChannelFeatures, NodeFeatures};
+       use ln::msgs::{LightningError, ErrorAction};
        use util::test_utils;
        use util::test_utils::TestVecWriter;
        use util::logger::Logger;
@@ -1111,7 +1113,7 @@ mod tests {
                                channels: vec!(NetworkMap::get_key(1, zero_hash.clone()), NetworkMap::get_key(3, zero_hash.clone())),
                                lowest_inbound_channel_fee_base_msat: 100,
                                lowest_inbound_channel_fee_proportional_millionths: 0,
-                               features: NodeFeatures::new(),
+                               features: NodeFeatures::empty(),
                                last_update: 1,
                                rgb: [0; 3],
                                alias: [0; 32],
@@ -1119,7 +1121,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(1, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: our_id.clone(),
                                        last_update: 0,
@@ -1145,7 +1147,7 @@ mod tests {
                                channels: vec!(NetworkMap::get_key(2, zero_hash.clone()), NetworkMap::get_key(4, zero_hash.clone())),
                                lowest_inbound_channel_fee_base_msat: 0,
                                lowest_inbound_channel_fee_proportional_millionths: 0,
-                               features: NodeFeatures::new(),
+                               features: NodeFeatures::empty(),
                                last_update: 1,
                                rgb: [0; 3],
                                alias: [0; 32],
@@ -1153,7 +1155,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(2, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: our_id.clone(),
                                        last_update: 0,
@@ -1179,7 +1181,7 @@ mod tests {
                                channels: vec!(NetworkMap::get_key(12, zero_hash.clone()), NetworkMap::get_key(13, zero_hash.clone())),
                                lowest_inbound_channel_fee_base_msat: 0,
                                lowest_inbound_channel_fee_proportional_millionths: 0,
-                               features: NodeFeatures::new(),
+                               features: NodeFeatures::empty(),
                                last_update: 1,
                                rgb: [0; 3],
                                alias: [0; 32],
@@ -1187,7 +1189,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(12, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: our_id.clone(),
                                        last_update: 0,
@@ -1219,7 +1221,7 @@ mod tests {
                                        NetworkMap::get_key(7, zero_hash.clone())),
                                lowest_inbound_channel_fee_base_msat: 0,
                                lowest_inbound_channel_fee_proportional_millionths: 0,
-                               features: NodeFeatures::new(),
+                               features: NodeFeatures::empty(),
                                last_update: 1,
                                rgb: [0; 3],
                                alias: [0; 32],
@@ -1227,7 +1229,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(3, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: node1.clone(),
                                        last_update: 0,
@@ -1250,7 +1252,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(4, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: node2.clone(),
                                        last_update: 0,
@@ -1273,7 +1275,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(13, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: node8.clone(),
                                        last_update: 0,
@@ -1299,7 +1301,7 @@ mod tests {
                                channels: vec!(NetworkMap::get_key(5, zero_hash.clone()), NetworkMap::get_key(11, zero_hash.clone())),
                                lowest_inbound_channel_fee_base_msat: 0,
                                lowest_inbound_channel_fee_proportional_millionths: 0,
-                               features: NodeFeatures::new(),
+                               features: NodeFeatures::empty(),
                                last_update: 1,
                                rgb: [0; 3],
                                alias: [0; 32],
@@ -1307,7 +1309,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(5, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: node3.clone(),
                                        last_update: 0,
@@ -1333,7 +1335,7 @@ mod tests {
                                channels: vec!(NetworkMap::get_key(6, zero_hash.clone()), NetworkMap::get_key(11, zero_hash.clone())),
                                lowest_inbound_channel_fee_base_msat: 0,
                                lowest_inbound_channel_fee_proportional_millionths: 0,
-                               features: NodeFeatures::new(),
+                               features: NodeFeatures::empty(),
                                last_update: 1,
                                rgb: [0; 3],
                                alias: [0; 32],
@@ -1341,7 +1343,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(6, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: node3.clone(),
                                        last_update: 0,
@@ -1364,7 +1366,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(11, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: node5.clone(),
                                        last_update: 0,
@@ -1390,7 +1392,7 @@ mod tests {
                                channels: vec!(NetworkMap::get_key(7, zero_hash.clone())),
                                lowest_inbound_channel_fee_base_msat: 0,
                                lowest_inbound_channel_fee_proportional_millionths: 0,
-                               features: NodeFeatures::new(),
+                               features: NodeFeatures::empty(),
                                last_update: 1,
                                rgb: [0; 3],
                                alias: [0; 32],
@@ -1398,7 +1400,7 @@ mod tests {
                                announcement_message: None,
                        });
                        network.channels.insert(NetworkMap::get_key(7, zero_hash.clone()), ChannelInfo {
-                               features: ChannelFeatures::new(),
+                               features: ChannelFeatures::empty(),
                                one_to_two: DirectionalChannelInfo {
                                        src_node_id: node3.clone(),
                                        last_update: 0,