From a9eed6c0e98db3f05f034ce5d1955c037551a399 Mon Sep 17 00:00:00 2001 From: John Smith Date: Thu, 4 Aug 2022 13:25:05 -0400 Subject: [PATCH] fix crash --- veilid-core/src/routing_table/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/veilid-core/src/routing_table/mod.rs b/veilid-core/src/routing_table/mod.rs index b894affb..816fdf6f 100644 --- a/veilid-core/src/routing_table/mod.rs +++ b/veilid-core/src/routing_table/mod.rs @@ -550,6 +550,10 @@ impl RoutingTable { pub fn lookup_node_ref(&self, node_id: DHTKey) -> Option { 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