Bitcoin Forum
November 16, 2018, 09:28:38 PM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
   Home   Help Search Login Register More  
Pages: [1]
Author Topic: Get header from height  (Read 472 times)
Offline Offline

Activity: 1204
Merit: 1002

View Profile
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.

Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!