This commit is contained in:
John Smith
2022-09-09 16:27:13 -04:00
parent b13f8947df
commit 72b03939ef
10 changed files with 99 additions and 51 deletions

View File

@@ -1425,14 +1425,13 @@ impl NetworkManager {
};
// Send boot magic to requested peer address
let data = BOOT_MAGIC.to_vec();
let out_data: Vec<u8> = match self
let out_data: Vec<u8> = network_result_value_or_log!(debug self
.net()
.send_recv_data_unbound_to_dial_info(dial_info, data, timeout_ms)
.await?
.await? =>
{
NetworkResult::Value(v) => v,
_ => return Ok(Vec::new()),
};
return Ok(Vec::new());
});
let bootstrap_peerinfo: Vec<PeerInfo> =
deserialize_json(std::str::from_utf8(&out_data).wrap_err("bad utf8 in boot peerinfo")?)

View File

@@ -181,8 +181,12 @@ impl NetworkManager {
let routing_table = self.routing_table();
for bootstrap_di in bootstrap_dialinfos {
log_net!(debug "direct bootstrap with: {}", bootstrap_di);
let peer_info = self.boot_request(bootstrap_di).await?;
log_net!(debug " direct bootstrap peerinfo: {:?}", peer_info);
// Got peer info, let's add it to the routing table
for pi in peer_info {
let k = pi.node_id.key;