Page MenuHomePhabricator

p2p: Unify Send and Receive protocol versions
ClosedPublic

Authored by Fabien on Tue, Feb 9, 16:41.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC21862c3cda83: 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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.