From 304e9fd1171adff129bd95856c787faf3118820b Mon Sep 17 00:00:00 2001 From: John Smith Date: Sun, 16 Jul 2023 13:29:41 -0400 Subject: [PATCH] nodeinfo update fix --- veilid-core/src/routing_table/bucket_entry.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/veilid-core/src/routing_table/bucket_entry.rs b/veilid-core/src/routing_table/bucket_entry.rs index f1265bfe..b2066539 100644 --- a/veilid-core/src/routing_table/bucket_entry.rs +++ b/veilid-core/src/routing_table/bucket_entry.rs @@ -259,6 +259,7 @@ impl BucketEntryInner { }; // See if we have an existing signed_node_info to update or not + let mut node_info_changed = false; if let Some(current_sni) = opt_current_sni { // Always allow overwriting invalid/unsigned node if current_sni.has_any_signature() { @@ -277,6 +278,11 @@ impl BucketEntryInner { } return; } + + // See if anything has changed in this update beside the timestamp + if signed_node_info.node_info() != current_sni.node_info() { + node_info_changed = true; + } } } @@ -294,7 +300,9 @@ impl BucketEntryInner { // because the dial info could have changed and its safer to just reconnect. // The latest connection would have been the once we got the new node info // over so that connection is still valid. - self.clear_last_connections_except_latest(); + if node_info_changed { + self.clear_last_connections_except_latest(); + } } pub fn has_node_info(&self, routing_domain_set: RoutingDomainSet) -> bool {