3

I am reading the Bitcoin wiki, and I see the inv message structure. I see it has a counter field for the objects and an inventory field. This inventory field has a list of objects (transactions or blocks), and I do wonder what it sends to the neighbors as to check if they have the transaction or block relayed. For example, is the block sent with its hash or with an id?

  • A block's hash is its id. – Pieter Wuille Jun 10 '15 at 12:51
2

As you can see in the protocol documentation the inv-object contains a field inventory (Inventory Vector).

Inv-Object:

Inv-Object field table

Inventory Vector:

Inventory Vector field table

You need to check the type field to know what the other node is sending. You will always receive a hash value, which is the identifier of a block or transaction.

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.