<p>To be fair when the source says &quot;about&quot; 130 connections it doesn't claim to be exact. It's true that the maximum number of automatic connections is 125 per default, but on top of this there could also be up to 8 manual connections (using <em>addnode</em>) that are counted extra.</p>

CC BY-SA 4.0
2024-07-15T16:03:54.560Z
2024-07-15T16:03:54.560Z
Lightlike
<p>There can be a few additional short-lived connections not bound by the limit that you may see using CLI -netinfo or RPC getpeerinfo: feeler, address fetch, and extra outbound block-only relay connections.</p>
<p>The limit also does not apply to connections you added with the -addnode configuration option or the addnode RPC. Addnode peers have a separate limit of 8 connections.</p>
<p>Peer disconnections by your node when over the limit can also sometimes take enough time for you to briefly see a greater number than the limit.</p>

CC BY-SA 4.0
2024-07-26T16:31:46.930Z
2024-07-26T16:31:46.930Z
jonatack
<p>DEFAULT_MAX_PEER_CONNECTIONS is set to 125 by default in core to the best of my knowledge. However, I read in The Optech Newsletter #310 that it is 130... could not validate this info anywhere in the code-base or the internet. If any one knows where they deduced this figure of 130 from kindly let me know.</p>
<p>This is the exact text from the Newsletter:</p>
<p>● Node crash DoS from multiple peers with large messages: before Bitcoin Core 0.10.1, nodes would accept P2P messages up to about 32 megabytes in size. Nodes, then and now, also allowed up to about <strong>130 connections</strong> by default. If every peer sent a maximum-size message at roughly the same time, this would force a node to allocate about 4 gigabytes of memory in addition to the node’s other requirements, which was more than many nodes had available. The vulnerability was responsibly disclosed by BitcoinTalk.org user Evil-Knievel, assigned CVE-2015-3641, and fixed in Bitcoin Core 0.10.1 by limiting the maximum message size to about 2 megabytes (later increased to about 4 megabytes for segwit).</p>
<p><a href="https://bitcoinops.org/en/newsletters/2024/07/05/" rel="nofollow noreferrer">https://bitcoinops.org/en/newsletters/2024/07/05/</a></p>

CC BY-SA 4.0
2024-07-21T16:38:47.727Z
FWIW: when I wrote "about 130" in the newsletter I was uncertain whether 125 was the limit for inbound connections or all connections (including block-relay-only peers).  I didn't think the difference between 125 and 135 was significant in relation to the attack, so I settled on "about 130".
David A. Harding
<bitcoin-core><bitcoin-core-development><nodes><peers><connection>
DEFAULT_MAX_PEER_CONNECTIONS for Bitcoin Core is 125 or 130?
Faisal Qureshi
# DEFAULT_MAX_PEER_CONNECTIONS for Bitcoin Core is 125 or 130?

(Asked by: username_0 on 2024-07-15)

DEFAULT\_MAX\_PEER\_CONNECTIONS is set to 125 by default in core to the best of my knowledge. However, I read in The Optech Newsletter #310 that it is 130... could not validate this info anywhere in the code-base or the internet. If any one knows where they deduced this figure of 130 from kindly let me know.

This is the exact text from the Newsletter:

● Node crash DoS from multiple peers with large messages: before Bitcoin Core 0.10.1, nodes would accept P2P messages up to about 32 megabytes in size. Nodes, then and now, also allowed up to about **130 connections** by default. If every peer sent a maximum-size message at roughly the same time, this would force a node to allocate about 4 gigabytes of memory in addition to the node’s other requirements, which was more than many nodes had available. The vulnerability was responsibly disclosed by BitcoinTalk.org user Evil-Knievel, assigned CVE-2015-3641, and fixed in Bitcoin Core 0.10.1 by limiting the maximum message size to about 2 megabytes (later increased to about 4 megabytes for segwit).

<https://bitcoinops.org/en/newsletters/2024/07/05/>

**Tags:** bitcoin-core, bitcoin-core-development, nodes, peers, connection

> **Comments:**
> **username_1**: FWIW: when I wrote "about 130" in the newsletter I was uncertain whether 125 was the limit for inbound connections or all connections (including block-relay-only peers).  I didn't think the difference between 125 and 135 was significant in relation to the attack, so I settled on "about 130".  

---

## 2 answers

### Answer by username_2 on 2024-07-15. Score: 10

To be fair when the source says "about" 130 connections it doesn't claim to be exact. It's true that the maximum number of automatic connections is 125 per default, but on top of this there could also be up to 8 manual connections (using *addnode*) that are counted extra.


---

### Answer by username_3 on 2024-07-26. Score: 5

There can be a few additional short-lived connections not bound by the limit that you may see using CLI -netinfo or RPC getpeerinfo: feeler, address fetch, and extra outbound block-only relay connections.

The limit also does not apply to connections you added with the -addnode configuration option or the addnode RPC. Addnode peers have a separate limit of 8 connections.

Peer disconnections by your node when over the limit can also sometimes take enough time for you to briefly see a greater number than the limit.


---

