Bitcoin Forum
May 28, 2024, 02:41:15 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Get header from height  (Read 523 times)
TierNolan (OP)
Legendary
*
Offline Offline

Activity: 1232
Merit: 1084


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!