HomePhabricator

p2p: Unify Send and Receive protocol versions

Description

p2p: Unify Send and Receive protocol versions

Summary:

CNode has two members to keep protocol version:

    nRecvVersion for received messages
    nSendVersion for messages to send

After exchanging with VERSION and VERACK messages via protocol version
INIT_PROTO_VERSION, both nodes set nRecvVersion and nSendVersion to the
same value which is the greatest common protocol version.

This PR:

    replaces two CNode members, nRecvVersion nSendVersion, with
m_greatest_common_version
    removes duplicated getter and setter

There is no change in behavior on the P2P network.

Backport of core PR17785.

Depends on D9193.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

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

Details

Provenance
Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>Authored on Jun 5 2020, 07:22
FabienCommitted on Feb 9 2021, 20:12
FabienPushed on Feb 9 2021, 20:13
Reviewer
Restricted Project
Differential Revision
D9195: p2p: Unify Send and Receive protocol versions
Parents
rABC34ae942842d6: tests: Add fuzzing harness for CNode
Branches
Unknown
Tags
Unknown