Skip to content

Commit

Permalink
Ignore subsequent peers
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Mar 20, 2023
1 parent c33e48f commit 5058b05
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions protocols/gossipsub/src/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1620,10 +1620,13 @@ where

for p in px {
let dial_opts = if let Some(signed_peer_record) = p.signed_peer_record {
// If signed envelop is invalid, return None and ignore peer exchange
PeerRecord::from_signed_envelope(signed_peer_record)
.ok()
.map(|peer_record| (peer_record.peer_id(), peer_record.addresses().to_vec()))
// If signed envelop is invalid, return None and ignore this and next peer exchanges
match PeerRecord::from_signed_envelope(signed_peer_record) {
Ok(peer_record) => {
Some((peer_record.peer_id(), peer_record.addresses().to_vec()))
}
Err(_) => return,
}
} else {
p.peer_id.map(|peer_id| (peer_id, vec![]))
};
Expand Down

0 comments on commit 5058b05

Please sign in to comment.