Bitcoin

p2p – Why do we need sendcmpct for getdata(CMPCT) – low bandwidth relay?

BIP152 describes two types of block announcements:

  • High bandwidth relay (sendcmpct(1))
  • Low bandwidth relay (sendcmpct(0))

I understand why we need it sendcmpct This is the message for the first case. In this way, we send a compact block to tell our peers that we want to notify them. It’s similar to when we send it. send header The message is that you want to announce it through the header rather than inv.

I don’t understand why. sendcmpct In the second case you need a message. In the second case the notification is done via header/inv and if you want a compact block you have to send: Get Data (MSG_CMPCT_BLOCK). If you don’t want it, send MSG_BLOCK or MSG_WITNESS_BLOCK. So if you haven’t sent a message before, everything will work the same. sendcmpct Send a message first.

Related Articles

Back to top button