Fully replace NodeInstance
This commit is contained in:
@ -690,7 +690,7 @@ impl ClusterInfo {
|
|||||||
self.gossip.write().unwrap().set_self(&id);
|
self.gossip.write().unwrap().set_self(&id);
|
||||||
{
|
{
|
||||||
let mut instance = self.instance.write().unwrap();
|
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.keypair.write().unwrap() = new_keypair;
|
||||||
self.my_contact_info.write().unwrap().id = id;
|
self.my_contact_info.write().unwrap().id = id;
|
||||||
|
@ -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.
|
// Clones the value with an updated wallclock.
|
||||||
pub(crate) fn with_wallclock(&self, wallclock: u64) -> Self {
|
pub(crate) fn with_wallclock(&self, wallclock: u64) -> Self {
|
||||||
Self { wallclock, ..*self }
|
Self { wallclock, ..*self }
|
||||||
|
Reference in New Issue
Block a user