Page MenuHomePhabricator

[net/refactor] Rework ThreadOpenConnections logic
ClosedPublic

Authored by Fabien on Dec 21 2020, 12:44.

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABC5c39c9d8f014: [net/refactor] Rework ThreadOpenConnections logic
Summary
Make the connection counts explicit and extract into interface functions
around m_conn_type. Using explicit counting and switch statements where
possible should help prevent counting bugs in the future.

Partial backport (16/19) of core PR19316:
https://github.com/bitcoin/bitcoin/pull/19316/commits/7f7b83deb2427599c129f4ff581d4d045461e459

Depends on D8725.

Test Plan
ninja all check-all

Event Timeline

Fabien requested review of this revision.Dec 21 2020, 12:44
majcosta requested changes to this revision.Dec 21 2020, 13:59
majcosta added a subscriber: majcosta.
majcosta added inline comments.
src/net.cpp
2007–2013

there was a change to this comment, try ticking "Hide whitespace changes" on Github and it'll be clear

This revision now requires changes to proceed.Dec 21 2020, 13:59

Update comment. TIL you can add comments on blocks and not only a single line with phab

This revision is now accepted and ready to land.Dec 21 2020, 15:28