HomePhabricator

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

Description

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

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)
...

Reviewers: deadalnix, Fabien, jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Reviewed By: jasonbcox, O1 Bitcoin ABC, #bitcoin_abc

Differential Revision: https://reviews.bitcoinabc.org/D4251

Details

Provenance
nakihitoAuthored on Oct 14 2019, 21:58
nakihitoPushed on Oct 16 2019, 20:38
Reviewer
Restricted Owners Package
Differential Revision
D4251: Change CDnsSeedOpts to use std::string instead of c-strings
Parents
rABCaefa60f5c9fd: Introduce constant default variables to initialize seeder options
Branches
Unknown
Tags
Unknown