In the Bitcoin network, when a miner discovers a new block, he needs to broadcast it to other nodes. Does the node only broadcast to outbound connections or does it broadcast to inbound connections as well? I hope to get the result according to the source code and it would be great if the answer would point out the file of the corresponding code.
2 Answers
All peers are treated equally when relaying chain-extending blocks (as James C. stated in a comment on another answer). The node will announce the block to all of its peers and since that block was just found, all of the peers should request the new block.
Many miners will also announce new blocks on Fast Internet Bitcoin Relay Engine (FIBRE) in addition. Any new block on FIBRE will be immediately broadcast to all participants in a compressed format based on compact blocks (BIP152).
The number of peers connected to your node is configurable. You can increase it from 8. Your node will broadcast to the connected peers, who, in turn, will broadcast to their connected peers.
-
For each node, up to 8 nodes can be actively connected and 117 foreign connections can be accepted. So is the broadcast block broadcast to 125 nodes or just to the actively established nodes?– and zhaoNov 25, 2018 at 12:54
-
1You can configure inbound, outbound and permanent connections for your node. I am not sure what 117 refers to, inbound? Outbound connections are also foreign as their addresses are discovered on the network(not permanent). In any case, you can set the limits there. All connections are treated equally in respect to broadcasting, propagating of chain-extending blocks.– James C.Nov 30, 2018 at 7:58
-
This is no longer true. Blocks are no longer sent unsolicited. Aug 25, 2020 at 8:27