Bitcoin

Relay – Are header messages used to notify peers of new blocks?

As far as I know, when a new transaction or block is received, it sends an INV message to all peers to notify them. If a peer wants that data, it sends a GETDATA message. I have read and seen in several places (e.g. BIP152) that notification can also be done by sending a HEADER message (picture below taken from BIP 152). But the Bitcoin wiki and every other site says that this message is: Reply to a previously sent GETHEADERS message.

bitcoin.wiki:

The header packet returns a block header in response to the getheaders packet.

Bitcoin Developer:

The “headers” message sends block headers to nodes that previously requested specific headers via the “getheaders” message. The header message may be empty.

Can you explain why and under what circumstances the HEADER message is also used to notify colleagues of new blocks?

Enter image description here

Related Articles

Back to top button