Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/main.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | void SetupSeederArgs() { | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||
gArgs.AddArg("-proxyipv4=<ip:port>", "IPV4 SOCKS5 proxy IP/Port", | gArgs.AddArg("-proxyipv4=<ip:port>", "IPV4 SOCKS5 proxy IP/Port", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||
gArgs.AddArg("-proxyipv6=<ip:port>", "IPV6 SOCKS5 proxy IP/Port", | gArgs.AddArg("-proxyipv6=<ip:port>", "IPV6 SOCKS5 proxy IP/Port", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||
gArgs.AddArg("-filter=<f1,f2,...>", | gArgs.AddArg("-filter=<f1,f2,...>", | ||||
"Allow these flag combinations as filters", | "Allow these flag combinations as filters", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg( | |||||
"-connect=<ip>", | |||||
"Determines initial seeder connection behavior. -connect=1 starts " | |||||
"the seeder without any initial regulations on ips it can connect " | |||||
"to. -connect=0 disbales automatic connection to any initial ips. " | |||||
"-connect=<ip> prevents connection to all ips except <ip> (this is " | |||||
"short hand for -connect=0 -addseed=<ip>). See also: -addseed. " | |||||
"(default: 1)", | |||||
ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | |||||
deadalnix: What is it for? What problem does this solves? | |||||
gArgs.AddArg("-addseed=<ip>", | |||||
"Append <ip> to the initial list of allowable " | |||||
"connections. Can be set multiple times.", | |||||
ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); | |||||
gArgs.AddArg("-wipeban", "Wipe list of banned nodes", | gArgs.AddArg("-wipeban", "Wipe list of banned nodes", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||
gArgs.AddArg("-wipeignore", "Wipe list of ignored nodes", | gArgs.AddArg("-wipeignore", "Wipe list of ignored nodes", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); | ||||
gArgs.AddArg("-help-debug", | gArgs.AddArg("-help-debug", | ||||
"Show all debugging options (usage: --help -help-debug)", | "Show all debugging options (usage: --help -help-debug)", | ||||
ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); | ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); | ||||
SetupChainParamsBaseOptions(); | SetupChainParamsBaseOptions(); | ||||
▲ Show 20 Lines • Show All 297 Lines • ▼ Show 20 Lines | do { | ||||
Sleep(1000); | Sleep(1000); | ||||
} while (1); | } while (1); | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
const static unsigned int MAX_HOSTS_PER_SEED = 128; | const static unsigned int MAX_HOSTS_PER_SEED = 128; | ||||
extern "C" void *ThreadSeeder(void *) { | extern "C" void *ThreadSeeder(void *) { | ||||
std::vector<std::string> seeds; | |||||
std::string connect = gArgs.GetArg("-connect", "1"); | |||||
if (connect == "1") { | |||||
seeds = Params().DNSSeeds(); | |||||
} else if (connect != "0") { | |||||
seeds.push_back(connect); | |||||
} | |||||
if (gArgs.IsArgSet("-addseed")) { | |||||
deadalnixUnsubmitted Not Done Inline Actionsbitcoind uses "-addnode", why is this using "-addseed"? deadalnix: bitcoind uses "-addnode", why is this using "-addseed"? | |||||
auto addedSeeds = gArgs.GetArgs("-addseed"); | |||||
seeds.insert(seeds.end(), addedSeeds.begin(), addedSeeds.end()); | |||||
} | |||||
do { | do { | ||||
for (const std::string &seed : Params().DNSSeeds()) { | for (const std::string &seed : seeds) { | ||||
std::vector<CNetAddr> ips; | std::vector<CNetAddr> ips; | ||||
LookupHost(seed.c_str(), ips, MAX_HOSTS_PER_SEED, true); | LookupHost(seed.c_str(), ips, MAX_HOSTS_PER_SEED, true); | ||||
for (auto &ip : ips) { | for (auto &ip : ips) { | ||||
db.Add(CAddress(CService(ip, GetDefaultPort()), ServiceFlags()), | db.Add(CAddress(CService(ip, GetDefaultPort()), ServiceFlags()), | ||||
true); | true); | ||||
} | } | ||||
} | } | ||||
Sleep(1800000); | Sleep(1800000); | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |
What is it for? What problem does this solves?