<p>The client connects to peers in its database randomly (?) so even if given a set of IPs of peers in which all IPs are invalid (connection fails), the client will only be slightly disrupted by this.</p>

<p>A node with a lot of invalid IPs in its list of peers may take longer to find a peer that it can connect to, but at the same time that lack of connectivity prevents it from receiving any new transactions from the network as well.  So there's no increased risk of accepting a transaction that ends up being a double spnd.</p>

<p>This receipt of non-usable IPs can cause this specific node to not get a new block in a timely manner, but because nodes remain connected most of the time there isn't a system-wide issue just because some of the nodes remain disconnected longer than they should when switching to a new node.</p>

<p>When the node does come across a peer IP that it cannot connect to it will ban the node and not attempt to connect to it again for at least 24 hours.</p>

CC BY-SA 3.0
2012-12-16T12:08:48.757Z
2012-12-16T12:08:48.757Z
Stephen Gornick
<p>From what I've inferred, is that Bitcoin gets a list of peers from other nodes.  What is to prevent a malicious node from</p>

<ul>
<li><p>Sharing many ip addresses that will cause timeouts and a delay in block replication?</p></li>
<li><p>Using the getpeers to cause a DOS attack on an unsuspecting person/website?</p></li>
</ul>

<security><bitcoin-core><peers>
How does Bitcoin protect itself from invalid peers from being broadcasted?
makerofthings7
# How does Bitcoin protect itself from invalid peers from being broadcasted?

(Asked by: username_0 on 2012-12-15)

From what I've inferred, is that Bitcoin gets a list of peers from other nodes. What is to prevent a malicious node from

* Sharing many ip addresses that will cause timeouts and a delay in block replication?
* Using the getpeers to cause a DOS attack on an unsuspecting person/website?

**Tags:** security, bitcoin-core, peers


---

## 1 answers

### Answer by username_1 on 2012-12-16. Score: 2 | Accepted answer

The client connects to peers in its database randomly (?) so even if given a set of IPs of peers in which all IPs are invalid (connection fails), the client will only be slightly disrupted by this.

A node with a lot of invalid IPs in its list of peers may take longer to find a peer that it can connect to, but at the same time that lack of connectivity prevents it from receiving any new transactions from the network as well. So there's no increased risk of accepting a transaction that ends up being a double spnd.

This receipt of non-usable IPs can cause this specific node to not get a new block in a timely manner, but because nodes remain connected most of the time there isn't a system-wide issue just because some of the nodes remain disconnected longer than they should when switching to a new node.

When the node does come across a peer IP that it cannot connect to it will ban the node and not attempt to connect to it again for at least 24 hours.


---

