Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/main.cpp
Show First 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | void ParseCommandLine(int argc, char **argv) { | ||||
{"dnsthreads", required_argument, 0, 'd'}, | {"dnsthreads", required_argument, 0, 'd'}, | ||||
{"port", required_argument, 0, 'p'}, | {"port", required_argument, 0, 'p'}, | ||||
{"onion", required_argument, 0, 'o'}, | {"onion", required_argument, 0, 'o'}, | ||||
{"proxyipv4", required_argument, 0, 'i'}, | {"proxyipv4", required_argument, 0, 'i'}, | ||||
{"proxyipv6", required_argument, 0, 'k'}, | {"proxyipv6", required_argument, 0, 'k'}, | ||||
{"filter", required_argument, 0, 'w'}, | {"filter", required_argument, 0, 'w'}, | ||||
{"testnet", no_argument, &fUseTestNet, 1}, | {"testnet", no_argument, &fUseTestNet, 1}, | ||||
{"wipeban", no_argument, &fWipeBan, 1}, | {"wipeban", no_argument, &fWipeBan, 1}, | ||||
{"wipeignore", no_argument, &fWipeBan, 1}, | {"wipeignore", no_argument, &fWipeIgnore, 1}, | ||||
{"help", no_argument, 0, 'h'}, | {"help", no_argument, 0, 'h'}, | ||||
{0, 0, 0, 0}}; | {0, 0, 0, 0}}; | ||||
int option_index = 0; | int option_index = 0; | ||||
int c = | int c = | ||||
getopt_long(argc, argv, "h:n:m:t:p:d:o:i:k:w:", long_options, | getopt_long(argc, argv, "h:n:m:t:p:d:o:i:k:w:", long_options, | ||||
&option_index); | &option_index); | ||||
if (c == -1) break; | if (c == -1) break; | ||||
switch (c) { | switch (c) { | ||||
▲ Show 20 Lines • Show All 444 Lines • ▼ Show 20 Lines | if (fDNS && !opts.mbox) { | ||||
fprintf(stderr, "No e-mail address set. Please use -m.\n"); | fprintf(stderr, "No e-mail address set. Please use -m.\n"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
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; | ||||
if (opts.fWipeBan) db.banned.clear(); | if (opts.fWipeBan) { | ||||
if (opts.fWipeIgnore) db.ResetIgnores(); | db.banned.clear(); | ||||
fprintf(stdout, "Ban list wiped..."); | |||||
} | |||||
if (opts.fWipeIgnore) { | |||||
db.ResetIgnores(); | |||||
fprintf(stdout, "Ignore list wiped..."); | |||||
} | |||||
fprintf(stdout, "done\n"); | fprintf(stdout, "done\n"); | ||||
} | } | ||||
pthread_t threadDns, threadSeed, threadDump, threadStats; | pthread_t threadDns, threadSeed, threadDump, threadStats; | ||||
if (fDNS) { | if (fDNS) { | ||||
fprintf(stdout, "Starting %i DNS threads for %s on %s (port %i)...", | fprintf(stdout, "Starting %i DNS threads for %s on %s (port %i)...", | ||||
opts.nDnsThreads, opts.host, opts.ns, opts.nPort); | opts.nDnsThreads, opts.host, opts.ns, opts.nPort); | ||||
dnsThread.clear(); | dnsThread.clear(); | ||||
for (int i = 0; i < opts.nDnsThreads; i++) { | for (int i = 0; i < opts.nDnsThreads; i++) { | ||||
Show All 26 Lines |