mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
net: advertise support for ADDRv2 via new message
Introduce a new message `sendaddrv2` to signal support for ADDRv2. Send the new message immediately after sending the `VERACK` message. Add support for receiving and parsing ADDRv2 messages. Send ADDRv2 messages (instead of ADDR) to a peer if he has advertised support for it. Co-authored-by: Carl Dong <contact@carldong.me>
This commit is contained in:
@@ -76,6 +76,18 @@ extern const char* VERACK;
|
||||
* network.
|
||||
*/
|
||||
extern const char* ADDR;
|
||||
/**
|
||||
* The addrv2 message relays connection information for peers on the network just
|
||||
* like the addr message, but is extended to allow gossiping of longer node
|
||||
* addresses (see BIP155).
|
||||
*/
|
||||
extern const char *ADDRV2;
|
||||
/**
|
||||
* The sendaddrv2 message signals support for receiving ADDRV2 messages (BIP155).
|
||||
* It also implies that its sender can encode as ADDRV2 and would send ADDRV2
|
||||
* instead of ADDR to a peer that has signaled ADDRV2 support by sending SENDADDRV2.
|
||||
*/
|
||||
extern const char *SENDADDRV2;
|
||||
/**
|
||||
* The inv message (inventory message) transmits one or more inventories of
|
||||
* objects known to the transmitting peer.
|
||||
|
||||
Reference in New Issue
Block a user