Skip to content

Commit

Permalink
Prevent adding yourself as a peer (#1665)
Browse files Browse the repository at this point in the history
Merge pull request #1665

Prevent adding yourself as a peer

* pull/1665/head:
  Prevent adding yourself as a peer
  • Loading branch information
sdbondi committed Apr 3, 2020
2 parents 2898cca + b887818 commit 969dbc9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions applications/tari_base_node/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,14 @@ async fn add_peers_to_comms(comms: &CommsNode, peers: Vec<Peer>) -> Result<(), S
for p in peers {
let peer_desc = p.to_string();
info!(target: LOG_TARGET, "Adding seed peer [{}]", peer_desc);

if &p.public_key == comms.node_identity().public_key() {
info!(
target: LOG_TARGET,
"Attempting to add yourself [{}] as a seed peer to comms layer, ignoring request", peer_desc
);
continue;
}
comms
.peer_manager()
.add_peer(p)
Expand Down

0 comments on commit 969dbc9

Please sign in to comment.