This extracts the Network
and BIP155Network
logic to node/network
. The code has been living between netaddress
and netbase
and some compilation units include these large files when they only need a Network
enum or related method. Separating the code to a standalone unit in node
improves code separation and helps with using only what is needed.
I verified the include
headers with https://cirrus-ci.com/task/6749578737745920 generated by https://github.com/bitcoin/bitcoin/pull/27385/commits/8f647a65d3484c7acd2d97f4b055c582d7734b6f while this was in draft and carefully narrowed them down to the most relevant ones.
Possible todos for a follow-up: upgrade Network
to an enum class
, e.g. NET_I2P
becomes Network::I2P
and https://github.com/bitcoin/bitcoin/pull/27385/commits/5cfa3fb8b5815aaf96483a63526e5f0bf3c0a06b.