HomePhabricator

net: advertise support for ADDRv2 via new message

Description

net: advertise support for ADDRv2 via new message

Summary:

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.

Partial backport (3/4) of core PR19954:
https://github.com/bitcoin/bitcoin/pull/19954/commits/353a3fdaad055eea42a0baf7326bdd591f541170

Depends on D9199.

Some functional tests required a debug log message update since we where
using a slightly different form from core. The new code is in sync with
core's message to make later backports easier.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Subscribers: majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9200

Details

Provenance
Vasil Dimov <vd@FreeBSD.org>Authored on May 20 2020, 10:05
FabienCommitted on Feb 11 2021, 08:27
FabienPushed on Feb 11 2021, 08:29
Reviewer
Restricted Project
Differential Revision
D9200: net: advertise support for ADDRv2 via new message
Parents
rABCe9b2955f860d: net: CAddress & CAddrMan: (un)serialize as ADDRv2
Branches
Unknown
Tags
Unknown