mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-07-15 11:19:35 -04:00
fix crash
This commit is contained in:
parent
0106f682f7
commit
a9eed6c0e9
1 changed files with 4 additions and 0 deletions
|
@ -550,6 +550,10 @@ impl RoutingTable {
|
|||
|
||||
pub fn lookup_node_ref(&self, node_id: DHTKey) -> Option<NodeRef> {
|
||||
let inner = self.inner.read();
|
||||
if node_id == self.node_id() {
|
||||
log_rtab!(debug "can't look up own node id in routing table");
|
||||
return None;
|
||||
}
|
||||
let idx = Self::find_bucket_index(&*inner, node_id);
|
||||
let bucket = &inner.buckets[idx];
|
||||
bucket
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue