|
May 27, 2013, 04:14:48 PM |
|
The current protocol doesn't allow parallel downloading of the block headers.
The get header packet requires that you know the hash of the header you want to start at.
A better system would be to allow requests to be split.
For example, you could give the start header and a positive offset.
int version var_int: hash_count hash[hash_count]: block locator hashes hash: stop_hash int: start_offset int: end_offset
If the last block in the block locator hash is on the main chain, reply headers starting at start offset blocks after the hash. Otherwise, send end_offset - start_offset hashes starting at the latest known block that is on the chain.
If you were connected to 10 other nodes, you could ask for 512 headers of the next 5120 blocks from each of them. This means you can download in parallel.
You are still mostly downloading in sequence and would have to verify the 512 sub-chain as you merge it in its entirely to the full chain.
|