HomePhabricator

refactor: move CAddress-without-nTime logic to net_processing

Description

refactor: move CAddress-without-nTime logic to net_processing

Summary:
Historically, the VERSION message contains an "addrMe" and an "addrYou". As
these are sent before version negotiation is complete, the protocol version is
INIT_PROTO_VERSION (209), and in that protocol, CAddress is serialized without
nTime.

This is in fact the only situation left where a CAddress is (de)serialized
without nTime. As it's such a simple structure (CService for ip/port + uint64_t
for nServices), just inline that structure in the few places where it occurs,
and remove the logic for dealing with missing nTime from CAddress.

This is a backport of core#20541
with a minor net_tests.cpp change from core#20196 (backported out of sequence in D14690)

Depends on D14752

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Dec 1 2020, 19:00
PiRKCommitted on Nov 8 2023, 15:10
PiRKPushed on Nov 8 2023, 15:10
Reviewer
Restricted Project
Differential Revision
D14753: refactor: move CAddress-without-nTime logic to net_processing
Parents
rABC7a098167fe03: Introduce well-defined CAddress disk serialization
Branches
Unknown
Tags
Unknown