Page MenuHomePhabricator

[net/refactor] Simplify multiple-connection checks
ClosedPublic

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

Details

Reviewers
majcosta
Group Reviewers
Restricted Project
Commits
rABCe7ca7c23573a: [net/refactor] Simplify multiple-connection checks
Summary
Extract logic that check multiple connection types into interface
functions & structure as switch statements. This makes it very clear
what touch points are for accessing `m_conn_type` & using the switch
statements enables the compiler to warn if a new connection type is
introduced but not handled for these cases.

Partial backport (17/19) of core PR19316:
https://github.com/bitcoin/bitcoin/pull/19316/commits/2f2e13b6c2c8741ca9d825eaaef736ede484bc85

Depends on D8726.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable