Bitcoin ABC  0.24.7
P2P Digital Currency
dnsseeds.cpp
Go to the documentation of this file.
1 // Copyright (c) 2021 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <dnsseeds.h>
6 
7 #include <random.h>
8 #include <util/system.h>
9 
10 const std::vector<std::string>
13  std::vector<std::string> seeds;
14  if (gArgs.IsArgSet("-overridednsseed")) {
15  seeds = {gArgs.GetArg("-overridednsseed", "")};
16  } else {
17  seeds = params.vSeeds;
18  }
19 
20  Shuffle(seeds.begin(), seeds.end(), rng);
21  return seeds;
22 }
ArgsManager::IsArgSet
bool IsArgSet(const std::string &strArg) const
Return true if the given argument has been manually set.
Definition: system.cpp:400
CChainParams
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Definition: chainparams.h:47
CChainParams::vSeeds
std::vector< std::string > vSeeds
Definition: chainparams.h:106
random.h
GetRandomizedDNSSeeds
const std::vector< std::string > GetRandomizedDNSSeeds(const CChainParams &params)
Return the list of hostnames to look up for DNS seeds.
Definition: dnsseeds.cpp:11
ArgsManager::GetArg
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
Definition: system.cpp:498
Shuffle
void Shuffle(I first, I last, R &&rng)
More efficient than using std::shuffle on a FastRandomContext.
Definition: random.h:251
system.h
gArgs
ArgsManager gArgs
Definition: system.cpp:75
dnsseeds.h
FastRandomContext
Fast randomness source.
Definition: random.h:129