4

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?

1
  • A block's hash is its id. Jun 10, 2015 at 12:51

1 Answer 1

3

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 and acknowledge you have read our privacy policy.

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