Blocks are downloaded in collection from a given peer, however a node can obtain blocks from a number of friends on the identical time, successfully downloading blocks in parallel. This parallel downloading shouldn’t be about downloading completely different elements of the identical block from completely different friends, however fairly downloading completely different blocks from completely different friends.
This design permits a node to obtain the blockchain extra shortly, as it’s not restricted by the add velocity of a single peer. It additionally provides a layer of redundancy.
Regardless of the parallel downloading of blocks, they have to be processed serially. That is important for the node to keep up correct details about the prevailing unspent transaction outputs (UTXOs) and to confirm the validity of transactions.
The precise implementation of this course of in Bitcoin Core is kind of advanced and includes varied elements like dealing with timeouts, validating blocks, and so forth. You’ll be able to evaluate the precise code within the Bitcoin Core GitHub repository to get a deeper understanding.
You may additionally examine the P2P Community a part of Bitcoin Developer website – see the reason for Block, GetBlocks, GetData, GetHeaders messages, which are concerned when blocks are despatched between nodes.