From 2b7a8180a94738c2fcb21232a2eca07a7b27656d Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 30 Jan 2022 22:46:25 +0100 Subject: 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. --- src/init.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/init.cpp') diff --git a/src/init.cpp b/src/init.cpp index ce666534ae..89418bc1f7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1301,6 +1301,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) } for (int n = 0; n < NET_MAX; n++) { enum Network net = (enum Network)n; + assert(IsReachable(net)); if (!nets.count(net)) SetReachable(net, false); } -- cgit v1.2.3