Fully replace NodeInstance
This commit is contained in:
parent
71efac46cb
commit
db3a9ae7fb
|
@ -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;
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue