From 724adb158c59bc708c139b0ff3930ce7e96b6a5e Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sat, 2 Dec 2017 18:05:43 -0800 Subject: [PATCH] server: lookup DNS seeds directly by active chain's genesis hash In this commit, we fix a bug that would cause the DNS seeds to be *always* active regardless of which chain+network we were on. Before we would look up the network in the reverseChainMap. However, if we were on regtest or testate, then it would still (incorrectly) resolve to a valid hash. To remedy this, we now directly use the genesis hash of the current active chain. --- server.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/server.go b/server.go index c9be3f09c..4a431b3f1 100644 --- a/server.go +++ b/server.go @@ -502,8 +502,7 @@ func initNetworkBootstrappers(s *server) ([]discovery.NetworkPeerBootstrapper, e // If this isn't simnet mode, then one of our additional bootstrapping // sources will be the set of running DNS seeds. if !cfg.Bitcoin.SimNet || !cfg.Litecoin.SimNet { - chainHash := reverseChainMap[registeredChains.PrimaryChain()] - dnsSeeds, ok := chainDNSSeeds[chainHash] + dnsSeeds, ok := chainDNSSeeds[*activeNetParams.GenesisHash] // If we have a set of DNS seeds for this chain, then we'll add // it as an additional boostrapping source.