HomePhabricator

[net processing] Remove fClient and m_limited_node

Description

[net processing] Remove fClient and m_limited_node

Summary:

[net processing] Remove fClient and m_limited_node

fClient is replaced by CanServeBlocks(), and m_limited_node is replaced
by IsLimitedPeer().

https://github.com/bitcoin/bitcoin/pull/25514/commits/f65e83d51bfb6a34f1d5efccfb3d8786a51a4534

[net processing] Inline and simplify UpdatePreferredDownload

We inline UpdatePreferredDownload because it is only used in one
location during the version handshake. We simplify it by removing the
initial subtraction of state->fPreferredDownload from
nPreferredDownload. This is ok since the version handshake is only
called once per peer and state->fPreferredDownload will always be
false before the newly inlined code is called, making the subtraction a
noop.

https://github.com/bitcoin/bitcoin/pull/24543/commits/a4c55a93ef9277e1043c286120e2417652ee8bbb

This is a partial backport of core#25514 and core#24543

Depends on D14746

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Jul 20 2020, 13:45
PiRKCommitted on Nov 8 2023, 15:10
PiRKPushed on Nov 8 2023, 15:10
Reviewer
Restricted Project
Differential Revision
D14747: [net processing] Remove fClient and m_limited_node
Parents
rABC8808e1dd123a: [tests] Connect peer in outbound_slow_chain_eviction by sending p2p messages
Branches
Unknown
Tags
Unknown