Author

Topic: "getheaders", how do they work? (Read 1707 times)

full member
Activity: 123
Merit: 100
November 15, 2011, 06:02:42 AM
#3
Can you elaborate a bit , just bumped into the same problem.
member
Activity: 77
Merit: 10
February 04, 2011, 05:35:30 PM
#2
Eventually solved my own problem here, the protocol specification on the wiki was incorrect, the version number in getheaders ( & getblocks) is always included,*unless* SER_GETHASH is set, not if.
member
Activity: 77
Merit: 10
February 03, 2011, 07:53:18 AM
#1
In the course of writing a thin client I'm trying to use the getheaders command to download the initial blockheaders rather than the entire blockchain. As far as I can tell I'm sending the correct packet but no one ever responds with "headers".

The raw packet is:

f9beb4d967657468656164657273000041000000c21430dc016fe28c0ab6f1b372c1a6a246ae63f 74f931e8365e15a089c68d619000000000000000000000000000000000000000000000000000000 00000000000000000000

This should be (from reading the source code)

Code:
f9beb4d9... to ...c21430dc raw packet headers
01 varint representing the number of start hashes in the block locator (1)
6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 32 byte hash of genesis block
0000000000000000000000000000000000000000000000000000000000000000 32 byte null stop hash

In theory this should starting pushing "headers" packets in my direction containing block headers starting after the genesis block.

Am I doing anything obviously wrong?
Jump to: