node search fix
This commit is contained in:
parent
d4221bff77
commit
eda99bbd47
@ -404,7 +404,7 @@ impl NetworkConnection {
|
||||
}
|
||||
|
||||
pub fn debug_print(&self, cur_ts: Timestamp) -> String {
|
||||
format!("{} <- {} | {:x} | est {} sent {} rcvd {}",
|
||||
format!("{} <- {} | {} | est {} sent {} rcvd {}",
|
||||
self.descriptor.remote_address(),
|
||||
self.descriptor.local().map(|x| x.to_string()).unwrap_or("---".to_owned()),
|
||||
self.connection_id.as_u64(),
|
||||
|
@ -453,9 +453,9 @@ impl RPCProcessor {
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// Search the DHT for a single node and add it to the routing table and return the node reference
|
||||
/// Search the network for a single node and add it to the routing table and return the node reference
|
||||
/// If no node was found in the timeout, this returns None
|
||||
async fn search_dht_single_key(
|
||||
async fn search_for_node_id(
|
||||
&self,
|
||||
node_id: TypedKey,
|
||||
count: usize,
|
||||
@ -561,7 +561,7 @@ impl RPCProcessor {
|
||||
|
||||
// Search in preferred cryptosystem order
|
||||
let nr = match this
|
||||
.search_dht_single_key(node_id, node_count, fanout, timeout, safety_selection)
|
||||
.search_for_node_id(node_id, node_count, fanout, timeout, safety_selection)
|
||||
.await
|
||||
{
|
||||
TimeoutOr::Timeout => None,
|
||||
@ -571,13 +571,6 @@ impl RPCProcessor {
|
||||
}
|
||||
};
|
||||
|
||||
if let Some(nr) = &nr {
|
||||
if nr.node_ids().contains(&node_id) {
|
||||
// found a close node, but not exact within our configured resolve_node timeout
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(nr)
|
||||
})
|
||||
}
|
||||
|
@ -1661,6 +1661,7 @@ attach
|
||||
detach
|
||||
restart network
|
||||
contact <node>[<modifiers>]
|
||||
resolve <destination>
|
||||
ping <destination>
|
||||
appmessage <destination> <data>
|
||||
appcall <destination> <data>
|
||||
@ -1748,6 +1749,8 @@ record list <local|remote>
|
||||
self.debug_app_call(rest).await
|
||||
} else if arg == "appreply" {
|
||||
self.debug_app_reply(rest).await
|
||||
} else if arg == "resolve" {
|
||||
self.debug_resolve(rest).await
|
||||
} else if arg == "contact" {
|
||||
self.debug_contact(rest).await
|
||||
} else if arg == "nodeinfo" {
|
||||
|
Loading…
Reference in New Issue
Block a user