Skip to content
This repository has been archived by the owner on Jun 25, 2021. It is now read-only.

Commit

Permalink
fix: remove offline elder from vote recipients
Browse files Browse the repository at this point in the history
  • Loading branch information
maqi committed Feb 15, 2021
1 parent 8c2226b commit 3bcea21
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/routing/approved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,11 @@ impl Approved {

// Send vote to all our elders.
fn vote(&self, vote: Vote) -> Result<Vec<Command>> {
let elders: Vec<_> = self.section.elders_info().peers().copied().collect();
let mut elders: Vec<_> = self.section.elders_info().peers().copied().collect();
// Exclude the offline elder from the recipients.
if let Vote::Offline(ref info) = vote {
elders.retain(|elder| elder.name() != info.peer.name());
}
self.send_vote(&elders, vote)
}

Expand Down
1 change: 0 additions & 1 deletion src/routing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ async fn handle_message(stage: Arc<Stage>, bytes: Bytes, sender: SocketAddr) {
"Error occurred when deserialising node message bytes from {}: {}",
sender, error
);
return;
}
}
}
Expand Down

0 comments on commit 3bcea21

Please sign in to comment.