<p>The documentation you are linking too is wrong, the <a href="https://bitcoin.org/en/developer-reference#getdata" rel="nofollow">bitcoin developer reference</a> indicates you can send multiple inventories inside of a <code>GetData</code> message. </p>

CC BY-SA 3.0
2016-09-05T15:51:51.863Z
It's not wrong, but maybe not very client. The `[]` after `inv_vect` indicates it's about an array of entries.
Pieter Wuille
CC BY-SA 3.0
2016-09-05T18:45:29.080Z
Not sure what you mean by 'very client' you mean varies by client version?
Chris Stewart
CC BY-SA 3.0
2016-09-05T18:57:39.650Z
Sorry, "very clear" !
Pieter Wuille
CC BY-SA 3.0
2016-11-04T17:21:42.207Z
Sorry, I was talking about the protocol spec copy-paste. The statement "Request a single block or transaction by hash" is clearly wrong.
Pieter Wuille
CC BY-SA 3.0
2016-09-05T15:23:25.480Z
2016-09-05T15:23:25.480Z
Chris Stewart
<p>After a node receives an <code>inv</code> message, you can get the data for each tx/block hash using <code>getdata</code>:</p>

<blockquote>
  <p>getdata - Request a single block or transaction by hash.</p>
</blockquote>

<p>So if you can only get one tx or block at a time, what's the purpose of having a field in the <code>getdata</code> message for the <em>number of entries</em> you are requesting?</p>

<blockquote>
<pre><code>Field Size  Description   Data type   Comments
----------  ------------  ----------  -------------
?           count         var_int     Number of inventory entries
36x?        inventory     inv_vect[]  Inventory vectors
</code></pre>
</blockquote>

<hr>

<p><a href="https://wiki.bitcoin.com/w/Network#Messages" rel="nofollow">https://wiki.bitcoin.com/w/Network#Messages</a>
<a href="https://en.bitcoin.it/wiki/Protocol_documentation#getdata" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_documentation#getdata</a></p>

<protocol><network>
Why does getdata have a field for the number of inventory entries?
inersha
# Why does getdata have a field for the number of inventory entries?

(Asked by: username_0 on 2016-09-05)

After a node receives an inv message, you can get the data for each tx/block hash using getdata:

getdata - Request a single block or transaction by hash.

So if you can only get one tx or block at a time, what's the purpose of having a field in the getdata message for the number of entries you are requesting?

Field Size  Description   Data type   Comments
----------  ------------  ----------  -------------
?           count         var_int     Number of inventory entries
36x?        inventory     inv_vect[]  Inventory vectors



https://wiki.bitcoin.com/w/Network#Messages
https://en.bitcoin.it/wiki/Protocol_documentation#getdata

**Tags:** protocol, network


---

## 1 answers

### Answer by username_1 on 2016-09-05. Score: 1

The documentation you are linking too is wrong, the [bitcoin developer reference](https://bitcoin.org/en/developer-reference#getdata) indicates you can send multiple inventories inside of a `GetData` message.

> **Comments:**
> **username_2**: It's not wrong, but maybe not very client. The `[]` after `inv_vect` indicates it's about an array of entries.  
> **username_1**: Not sure what you mean by 'very client' you mean varies by client version?  
> **username_2**: Sorry, "very clear" !  
> **username_2**: Sorry, I was talking about the protocol spec copy-paste. The statement "Request a single block or transaction by hash" is clearly wrong.  

---

