refactor: Avoid using IsArgSet() on -signetseednode and -signetchallenge list options

This commit does not change behavior because negation of -signetseednode and
-signetchallenge parameters has been disallowed since these were introduced in
#18267, so calling IsArgSet() is equivalent to checking if GetArgs() returns a
non-empty list.
This commit is contained in:
Ryan Ofsky 2019-12-19 18:00:04 -05:00
parent d05668922a
commit 3c2920ec98

View file

@ -25,10 +25,10 @@ using util::SplitString;
void ReadSigNetArgs(const ArgsManager& args, CChainParams::SigNetOptions& options)
{
if (args.IsArgSet("-signetseednode")) {
if (!args.GetArgs("-signetseednode").empty()) {
options.seeds.emplace(args.GetArgs("-signetseednode"));
}
if (args.IsArgSet("-signetchallenge")) {
if (!args.GetArgs("-signetchallenge").empty()) {
const auto signet_challenge = args.GetArgs("-signetchallenge");
if (signet_challenge.size() != 1) {
throw std::runtime_error("-signetchallenge cannot be multiple values.");