Skip to content

Commit

Permalink
Fix PeerList::witnesses() to only return witnesses
Browse files Browse the repository at this point in the history
  • Loading branch information
romac committed Jun 30, 2020
1 parent 8826a03 commit e371271
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions light-client/src/peer_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,8 @@ impl PeerList {
/// Get a list of references to all the witnesses,
/// (ie. all peers which are not the primary).
pub fn witnesses(&self) -> Vec<&Instance> {
self.instances
.keys()
.filter(|peer_id| peer_id != &&self.primary)
self.witnesses
.iter()
.filter_map(|peer_id| self.get(peer_id))
.collect()
}
Expand Down

0 comments on commit e371271

Please sign in to comment.