Skip to content

Commit

Permalink
Bugfix: Allow -noproxy and -proxy= command line options
Browse files Browse the repository at this point in the history
Hacky but simple alternative to bitcoin#24830
  • Loading branch information
luke-jr committed Apr 19, 2022
1 parent 7540a95 commit 17c0fc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/init.cpp
Expand Up @@ -1026,7 +1026,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)

nMaxTipAge = args.GetIntArg("-maxtipage", DEFAULT_MAX_TIP_AGE);

if (args.IsArgSet("-proxy") && args.GetArg("-proxy", "").empty()) {
if (args.IsArgSet("-proxy") && args.GetArg("-proxy", "") == std::string(1, 0)) {
return InitError(_("No proxy server specified. Use -proxy=<ip> or -proxy=<ip:port>."));
}

Expand Down
5 changes: 5 additions & 0 deletions src/util/system.cpp
Expand Up @@ -360,6 +360,11 @@ bool ArgsManager::ParseParameters(int argc, const char* const argv[], std::strin
std::optional<util::SettingsValue> value = InterpretValue(keyinfo, val, *flags, error);
if (!value) return false;

if (is_index == std::string::npos && keyinfo.name == "proxy" && !keyinfo.negated) {
assert(value->get_str() == "");
value = std::string(1, 0);
}

m_settings.command_line_options[keyinfo.name].push_back(*value);
}

Expand Down

0 comments on commit 17c0fc3

Please sign in to comment.