Bitcoin Forum
December 07, 2016, 12:30:15 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: "getheaders", how do they work?  (Read 1421 times)
dirtyfilthy
Member
**
Offline Offline

Activity: 75


View Profile
February 03, 2011, 12:53:18 PM
 #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?

Address: 1EkSP5Uqf5Fhs8Gg4XJG2b3hrFS7Vm8WFz
1481113815
Hero Member
*
Offline Offline

Posts: 1481113815

View Profile Personal Message (Offline)

Ignore
1481113815
Reply with quote  #2

1481113815
Report to moderator
1481113815
Hero Member
*
Offline Offline

Posts: 1481113815

View Profile Personal Message (Offline)

Ignore
1481113815
Reply with quote  #2

1481113815
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
dirtyfilthy
Member
**
Offline Offline

Activity: 75


View Profile
February 04, 2011, 10: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.

Address: 1EkSP5Uqf5Fhs8Gg4XJG2b3hrFS7Vm8WFz
romanticon
Full Member
***
Offline Offline

Activity: 122


View Profile
November 15, 2011, 11:02:42 AM
 #3

Can you elaborate a bit , just bumped into the same problem.
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!