0

I am building my own bitcoin client, and I have most of the protocol working from https://en.bitcoin.it/wiki/Protocol_Specification.

I successfully make a connection with the version and verack commands. And when I send a ping, I get back a pong with the same nonce.

The problem I am having now is that I don't get the expected response to my getblocks message. I build the block locator using the hash of the genesis block header, and I serialize the message and send it.

But then I don't get the inv message with MSG_BLOCK like I expect.

These are the raw bytes that I send as my getblocks message:

f9beb4d9676574626c6f636b73000000450000008634d5ae0100000001000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f0000000000000000000000000000000000000000000000000000000000000000

This is built following the specification here https://en.bitcoin.it/wiki/Protocol_Specification#getblocks.

  • Your question got cut off! – kaoD Jan 14 '14 at 15:01
  • Should be fixed now. – yzernik Jan 14 '14 at 18:57
  • 1
    Just guessing: try reversing the order of char[32] of the hash. I'm doing offline blockchain analysis and it's stored as trailing zeroes, not leading. – kaoD Jan 14 '14 at 19:19
0

I actually do receive the inv message. The problem is in the way that I try to decode the inv message.

The getblocks message seems to work fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.