net, init: assert each network reachability is true by default

The default network reachability values are implicitly set
by this line in net.cpp:

static bool vfLimited[NET_MAX] GUARDED_BY(g_maplocalhost_mutex) = {};

This commit asserts that each network is reachable during
the first loop through them during bitcoind init.
This commit is contained in:
Jon Atack 2022-01-30 22:46:25 +01:00
parent 848b11615b
commit 2b7a8180a9
No known key found for this signature in database
GPG key ID: 796C4109063D4EAF

View file

@ -1301,6 +1301,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
} }
for (int n = 0; n < NET_MAX; n++) { for (int n = 0; n < NET_MAX; n++) {
enum Network net = (enum Network)n; enum Network net = (enum Network)n;
assert(IsReachable(net));
if (!nets.count(net)) if (!nets.count(net))
SetReachable(net, false); SetReachable(net, false);
} }