```
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.