Page MenuHomePhabricator

Change CDnsSeedOpts to use std::string instead of c-strings
ClosedPublic

Authored by nakihito on Oct 14 2019, 22:05.

Details

Summary

Using std::string is safer, easier to read, and more flexible for future
changes. This additionally paves the way for a smoother integration of
gArgs to replace get_opts().

Depends on D4250

Test Plan
make
./bitcoin-seeder

Kill bitcoin-seeder

./bitcoin-seeder -h seeder.bitframe.org -n dev.bitframe.org -p 5364 -m info@bitframe.org --testnet -w 1,5 -t 95 -d 5 --wipeban --wipeignore

The first bitcoin-seeder call should output something like below:

Supporting whitelisted filters: 0x1,0x5,0x11,0x15
No nameserver set. Not starting DNS server.
Loading dnsseed.dat...done
Starting seeder...done
Starting 96 crawler threads...2019-10-14T22:16:06Z connect() to [2600:8806:8600:1d0:a5f0:9863:3144:6f16]:28333 failed: Cannot assign requested address (99)
...

The second bitcoin-seeder call should output something like below:

Supporting whitelisted filters: 0x1,0x5
Using testnet.
Loading dnsseed.dat...Ban list wiped...Ignore list wiped...done
Starting 5 DNS threads for seeder.bitframe.org on dev.bitframe.org (port 5364)........done
Starting seeder...done
Starting 95 crawler threads...2019-10-14T20:04:11Z connect() to [2600:8806:8600:1d0:a5f0:9863:3144:6f16]:28333 failed: Cannot assign requested address (99)
...

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 14 2019, 22:05

I don't agree that this is easier to read, but I do agree with where this is heading and that it will integrate with ArgsManager better.

This revision is now accepted and ready to land.Oct 15 2019, 00:19