0

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

1

The documentation you are linking too is wrong, the bitcoin developer reference indicates you can send multiple inventories inside of a GetData message.

  • It's not wrong, but maybe not very client. The [] after inv_vect indicates it's about an array of entries. – Pieter Wuille Sep 5 '16 at 15:51
  • Not sure what you mean by 'very client' you mean varies by client version? – Chris Stewart Sep 5 '16 at 18:45
  • Sorry, "very clear" ! – Pieter Wuille Sep 5 '16 at 18:57
  • 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 Nov 4 '16 at 17:21

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.