Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/main.cpp
Show First 20 Lines • Show All 346 Lines • ▼ Show 20 Lines | extern "C" void *ThreadSeeder(void *) { | ||||
return nullptr; | return nullptr; | ||||
} | } | ||||
static void SetupSeederArgs() { | static void SetupSeederArgs() { | ||||
gArgs.AddArg("-?", _("Print this help message and exit"), false, | gArgs.AddArg("-?", _("Print this help message and exit"), false, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-host=<host>", _("Hostname of the DNS seed"), false, | gArgs.AddArg("-host=<host>", _("Hostname of the DNS seed"), false, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-ns=<ns>", _("Hostname of the nameserver"), false, | gArgs.AddArg("-nameserver=<ns>", _("Hostname of the nameserver"), false, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-mbox=<mbox>", _("E-Mail address reported in SOA records"), | gArgs.AddArg("-email=<mbox>", _("E-Mail address reported in SOA records"), | ||||
jasonbcox: `s/mbox/email/g` on this line would have caught the other use of `mbox` | |||||
false, OptionsCategory::OPTIONS); | false, OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-threads=<threads>", | gArgs.AddArg("-threads=<threads>", | ||||
_("Number of crawlers to run in parallel (default 96)"), false, | _("Number of crawlers to run in parallel (default 96)"), false, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-dnsthreads=<threads>", | gArgs.AddArg("-dnsthreads=<threads>", | ||||
_("Number of DNS server threads (default 4)"), false, | _("Number of DNS server threads (default 4)"), false, | ||||
OptionsCategory::OPTIONS); | OptionsCategory::OPTIONS); | ||||
gArgs.AddArg("-port=<port>", _("UDP port to listen on (default 53)"), false, | gArgs.AddArg("-port=<port>", _("UDP port to listen on (default 53)"), false, | ||||
▲ Show 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | if (gArgs.GetBoolArg("-testnet", false)) { | ||||
netMagic[1] = 0xe5; | netMagic[1] = 0xe5; | ||||
netMagic[2] = 0xf3; | netMagic[2] = 0xf3; | ||||
netMagic[3] = 0xf4; | netMagic[3] = 0xf4; | ||||
seeds = testnet_seeds; | seeds = testnet_seeds; | ||||
fTestNet = true; | fTestNet = true; | ||||
} | } | ||||
// Get hostname of nameserver | // Get hostname of nameserver | ||||
if (gArgs.IsArgSet("-ns")) { | if (gArgs.IsArgSet("-nameserver")) { | ||||
opts.ns = gArgs.GetArg("-ns", "").c_str(); | opts.ns = gArgs.GetArg("-nameserver", "").c_str(); | ||||
} else { | } else { | ||||
// No hostname set | // No hostname set | ||||
fprintf(stdout, "No nameserver set. Not starting DNS server.\n"); | fprintf(stdout, "No nameserver set. Not starting DNS server.\n"); | ||||
fDNS = false; | fDNS = false; | ||||
} | } | ||||
// Get hostname of DNS seed | // Get hostname of DNS seed | ||||
if (gArgs.IsArgSet("-host")) { | if (gArgs.IsArgSet("-host")) { | ||||
opts.host = gArgs.GetArg("-host", "").c_str(); | opts.host = gArgs.GetArg("-host", "").c_str(); | ||||
} | } | ||||
if (fDNS && !opts.host) { | if (fDNS && !opts.host) { | ||||
fprintf(stderr, "No hostname set. Please use -host.\n"); | fprintf(stderr, "No hostname set. Please use -host.\n"); | ||||
return false; | return false; | ||||
} | } | ||||
// Get email | // Get email | ||||
if (gArgs.IsArgSet("-mbox")) { | if (gArgs.IsArgSet("-email")) { | ||||
opts.mbox = gArgs.GetArg("-mbox", "").c_str(); | opts.mbox = gArgs.GetArg("-email", "").c_str(); | ||||
} | } | ||||
if (fDNS && !opts.mbox) { | if (fDNS && !opts.mbox) { | ||||
fprintf(stderr, "No e-mail address set. Please use -mbox.\n"); | fprintf(stderr, "No e-mail address set. Please use -email.\n"); | ||||
return false; | return false; | ||||
} | } | ||||
FILE *f = fsbridge::fopen("dnsseed.dat", "r"); | FILE *f = fsbridge::fopen("dnsseed.dat", "r"); | ||||
if (f) { | if (f) { | ||||
fprintf(stdout, "Loading dnsseed.dat..."); | fprintf(stdout, "Loading dnsseed.dat..."); | ||||
CAutoFile cf(f, SER_DISK, CLIENT_VERSION); | CAutoFile cf(f, SER_DISK, CLIENT_VERSION); | ||||
cf >> db; | cf >> db; | ||||
// Check for -wipeban and the -wipeignore | // Check for -wipeban and the -wipeignore | ||||
▲ Show 20 Lines • Show All 65 Lines • Show Last 20 Lines |
s/mbox/email/g on this line would have caught the other use of mbox