Post
Topic
Board Development & Technical Discussion
Re: Block headers download
by
TierNolan
on 15/04/2013, 22:05:43 UTC
I have trouble implementing parallel blockchain download (headers only). I read wiki back and forth, but do not understand:
1) What exactly is block locator object.
2) How to download headers before certain block (towards genesis block)
Now I can start from genesis and work up blockchain (using 0 as hash_stop). Is it possible to move in opposite direction (from newest blocks to genesis)?

You are supposed to start at the start and work forward.  The locator object is just hashes.  You effectively have to give the hash of the start and finish.  You can give extra hashes.  You are sending a list of hashes that you know about.  The other node will scan them, and start at the hash that has the highest height and is on the main chain.

You could use the getblocks message.  They returns the hash of the blocks in an "inv" packet.  However, that is 33 bytes long per entry, so you aren't really saving much.

For parallel download what is needed is a message that returns the hash of a block for a set of heights.