Fully replace NodeInstance

This commit is contained in:
Michael Vines 2021-06-28 15:24:36 -07:00
parent 71efac46cb
commit db3a9ae7fb
2 changed files with 1 additions and 6 deletions

View File

@ -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;

View File

@ -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 }