From db3a9ae7fbbfb16ff4b820f6c3ff3a6301e067f0 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 28 Jun 2021 15:24:36 -0700 Subject: [PATCH] Fully replace NodeInstance --- gossip/src/cluster_info.rs | 2 +- gossip/src/crds_value.rs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index a545bf095f..105994e630 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -690,7 +690,7 @@ impl ClusterInfo { self.gossip.write().unwrap().set_self(&id); { let mut instance = self.instance.write().unwrap(); - *instance = instance.with_id(id); + *instance = NodeInstance::new(&mut thread_rng(), id, timestamp()); } *self.keypair.write().unwrap() = new_keypair; self.my_contact_info.write().unwrap().id = id; diff --git a/gossip/src/crds_value.rs b/gossip/src/crds_value.rs index 7670c74ba9..5e58b8d215 100644 --- a/gossip/src/crds_value.rs +++ b/gossip/src/crds_value.rs @@ -407,11 +407,6 @@ impl NodeInstance { } } - // Clones the value with an updated id. - pub(crate) fn with_id(&self, from: Pubkey) -> Self { - Self { from, ..*self } - } - // Clones the value with an updated wallclock. pub(crate) fn with_wallclock(&self, wallclock: u64) -> Self { Self { wallclock, ..*self }