Changelly

Cryptocurrency

bitcoin core – How does a full node decide which outbound peers to have?

1 Mins read


Addresses for outbound connections are largely chosen at random. The filtering of addresses comes at the time the addresses are first received by the node before they are added to the address database. This filter checks what services the nodes offer, what network they are on (e.g. IPv4, IPv6, TOR), and the time that they were reported to last be seen. Your node will choose to store addresses that are recent, use a network that your node is connected to, and offers full node services (NODE_NETWORK and NODE_NETWORK_LIMITED). We also avoid nodes that have been recently disconnected or banned.

These addresses are stored in buckets. These buckets are based on /16 for IPv4 and /32 for IPv6. In the future, these buckets will be determined by Autonomous System.

When making outbound connections, nodes are basically chosen at random. Your node will ensure that each outbound node belong to different buckets. If a node is chosen that belongs to a bucket that already has an outbound connection, it is skipped. We also try to choose nodes that we didn’t already try to connect to recently unless we have built up a lot of failed connection attempts. Lastly, your node will try connect to nodes using the default port unless there have been a lot of failed connection attempts.

For nodes that you are specifically adding with addnode, these nodes do not take up the standard outbound connection slots. There are an additional 8 addnode connection slots. If these are full, then the node that you are adding will simply wait until one of those nodes disconnects before a connection to it is attempted. So there is no kicking of outbound peers at all.



Source link

Related posts
Cryptocurrency

6 Questions for Mati Greenspan of Quantum Economics – Cointelegraph Magazine

2 Mins read
We ask the buidlers in the blockchain and cryptocurrency sector for their thoughts on the industry… and we throw in a few…
Cryptocurrency

Crypto Conference DeFiCon 2021 to Be Hosted on December 18-19 in Brooklyn, NYC – Press release Bitcoin News

1 Mins read
press release PRESS RELEASE. The next crypto conference lighting up the season is DeFiCon 2021, hosted on December 18-19 in Brooklyn, NYC….
Cryptocurrency

China’s Hainan Province Ramps Up Crackdown on Crypto Mining Operations – Mining Bitcoin News

2 Mins read
The province of Hainan in South China has taken steps aimed at curbing crypto mining activities. Besides blacklisting the industry, local authorities…

Leave a Reply

Your email address will not be published. Required fields are marked *