Don't print leader update message unless leader actually updates (#4365)

This commit is contained in:
sakridge 2019-05-21 11:06:56 -07:00 committed by GitHub
parent 772ba41ede
commit f877fb8c8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -297,11 +297,13 @@ impl ClusterInfo {
/// Record the id of the current leader for use by `leader_tpu_via_blobs()`
pub fn set_leader(&mut self, leader_id: &Pubkey) {
warn!(
"{}: LEADER_UPDATE TO {} from {}",
self.gossip.id, leader_id, self.gossip_leader_id,
);
self.gossip_leader_id = *leader_id;
if *leader_id != self.gossip_leader_id {
warn!(
"{}: LEADER_UPDATE TO {} from {}",
self.gossip.id, leader_id, self.gossip_leader_id,
);
self.gossip_leader_id = *leader_id;
}
}
pub fn push_epoch_slots(&mut self, id: Pubkey, root: u64, slots: HashSet<u64>) {