Fixed adding boot nodes to discovery table; Ping optimization

This commit is contained in:
arkpar
2016-02-17 02:55:46 +01:00
parent a179722542
commit e4baf37bf8
2 changed files with 12 additions and 5 deletions

View File

@@ -374,12 +374,12 @@ impl<Message> Host<Message> where Message: Send + Sync + Clone {
host.info.write().unwrap().deref_mut().listen_port = port;
let boot_nodes = host.info.read().unwrap().config.boot_nodes.clone();
for n in boot_nodes {
host.add_node(&n);
}
if let Some(ref mut discovery) = host.discovery {
discovery.lock().unwrap().init_node_list(host.nodes.read().unwrap().unordered_entries());
}
for n in boot_nodes {
host.add_node(&n);
}
host
}