Bitcoin Forum
November 22, 2017, 04:56:57 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Get header from height  (Read 461 times)
TierNolan
Legendary
*
Offline Offline

Activity: 1120


View Profile
May 27, 2013, 04:14:48 PM
 #1

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.

1LxbG5cKXzTwZg9mjL3gaRE835uNQEteWF
Pages: [1]
  Print  
 
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!