Page MenuHomePhabricator

[net processing] Remove fClient and m_limited_node
ClosedPublic

Authored by PiRK on Nov 7 2023, 12:14.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC6a62c795ad47: [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

Event Timeline

PiRK requested review of this revision.Nov 7 2023, 12:14
Fabien added a subscriber: Fabien.
Fabien added inline comments.
src/net_processing.cpp
3802 ↗(On Diff #42974)

Nice to see this confusing flag gone, the name was horrible

This revision is now accepted and ready to land.Nov 8 2023, 09:26