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

<p>The getblocks message seems to work fine.</p>

CC BY-SA 3.0
2014-01-15T19:27:59.530Z
2014-01-15T19:27:59.530Z
yzernik
<p>I am building my own bitcoin client, and I have most of the protocol working from <a href="https://en.bitcoin.it/wiki/Protocol_Specification" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_Specification</a>.</p>

<p>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.</p>

<p>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.</p>

<p>But then I don't get the inv message with MSG_BLOCK like I expect.</p>

<p>These are the raw bytes that I send as my getblocks message:</p>

<pre><code>f9beb4d9676574626c6f636b73000000450000008634d5ae0100000001000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f0000000000000000000000000000000000000000000000000000000000000000
</code></pre>

<p>This is built following the specification here <a href="https://en.bitcoin.it/wiki/Protocol_Specification#getblocks" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_Specification#getblocks</a>.</p>

CC BY-SA 3.0
2014-01-14T15:01:19.817Z
Your question got cut off!
kaoD
CC BY-SA 3.0
2014-01-14T18:57:18.113Z
Should be fixed now.
yzernik
CC BY-SA 3.0
2014-01-14T19:19:02.773Z
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
<protocol><message>
Sending getblocks message but not getting inv message response
yzernik
# Sending getblocks message but not getting inv message response

(Asked by: username_0 on 2014-01-14)

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>.

**Tags:** protocol, message

> **Comments:**
> **username_1**: Your question got cut off!  
> **username_0**: Should be fixed now.  
> **username_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.  

---

## 1 answers

### Answer by username_0 on 2014-01-15. Score: 0 | Accepted answer

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.


---

