Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: alexrossi on March 04, 2022, 03:47:14 PM



Title: Question about inbound and outbound connections on bitcoin core
Post by: alexrossi on March 04, 2022, 03:47:14 PM
I have a question about a technical aspect on bitcoin core:

I've understood that when syncing, core only connect to outbound peers to get the blocks. Then, after the initial sync, if the firewall allows it, it start to get inbound connections (nodes that connect to the open 8333 port)

What is not clear to me is the block fetching after a full sync: will my node, even after syncing, only fetch new blocks from the 8-10 outbound connections, or it'll be able to get the blocks from every node connected? I assume for ex. that mempool transactions can be broadcasted by every node (inbound and outbound), but i'm not sure about new blocks.


Title: Re: Question about inbound and outbound connections on bitcoin core
Post by: jackg on March 04, 2022, 03:56:31 PM
Core will continue to do node discovery periodically while it's running to see if other nodes have longer chains and favours the ones that do have the longest chains and lowest ping/latency.

Nodes send a list of nodes they've connected to to other nodes to enable all nodes to do their own peer discovery (up to 1000 addresses for nodes can be sent to others but a much lower number will actually be used as you'll connect to many nodes from that list and get their peer discovery lists too).


Title: Re: Question about inbound and outbound connections on bitcoin core
Post by: alexrossi on March 04, 2022, 07:12:01 PM
Core will continue to do node discovery periodically while it's running to see if other nodes have longer chains and favours the ones that do have the longest chains and lowest ping/latency.

Nodes send a list of nodes they've connected to to other nodes to enable all nodes to do their own peer discovery (up to 1000 addresses for nodes can be sent to others but a much lower number will actually be used as you'll connect to many nodes from that list and get their peer discovery lists too).

Ok, so basically after a full sync, core ignore if a connection is inbound and outbound... when it receive a new block "alert" it gets the block as fast as it can, correct?


I'm asking this because only fetching new blocks from outbound nodes would greatly impact the speed of a fast propagation (let's say that I have the usual 10 outbound + 90 inbound, there is higher probability that one of the 90 will be faster to give a new block than the first 10).


Title: Re: Question about inbound and outbound connections on bitcoin core
Post by: odolvlobo on March 06, 2022, 08:14:28 AM
The only difference between inbound and outbound nodes is who initiates the connection. There is no distinction regarding information flow.