1

As far as I know, when we receive a new transaction or block, we send an INV message to all peers to inform them about it. If the peers want that data, they send us a GETDATA message. In several places (in BIP152 for example) I read and saw (picture below taken from BIP 152) that notification can also be done by sending a HEADER message? However, bitcoin wiki and all other sites say that this message is a reply to a previously sent GETHEADERS message.

bitcoin.wiki:

The headers packet returns block headers in response to a getheaders packet.

bitcoindeveloper:

The “headers” message sends block headers to a node which previously requested certain headers with a “getheaders” message. A headers message can be empty.

Can you explain to me whether the HEADER message is also used for notifying peers about new blocks, why and in which cases?

enter image description here

1 Answer 1

1

Since the introduction of BIP130 ("sendheaders"), a node can request that new block announcements are sent through a HEADERS message rather than through an INV. This avoids a roundtrip, in case the receiver first wants to verify the PoW of the header before downloading the actual block data.

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.