mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
scripted-diff: stop using the gArgs wrappers
They were temporary additions to ease the transition. -BEGIN VERIFY SCRIPT- find src/ -name "*.cpp" ! -wholename "src/util.h" ! -wholename "src/util.cpp" | xargs perl -i -pe 's/(?<!\.)(ParseParameters|ReadConfigFile|IsArgSet|(Soft|Force)?(Get|Set)(|Bool|)Arg(s)?)\(/gArgs.\1(/g' -END VERIFY SCRIPT-
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
1227be30ec
commit
bb81e17355
@@ -309,14 +309,14 @@ static bool ThreadHTTP(struct event_base* base, struct evhttp* http)
|
||||
/** Bind HTTP server to specified addresses */
|
||||
static bool HTTPBindAddresses(struct evhttp* http)
|
||||
{
|
||||
int defaultPort = GetArg("-rpcport", BaseParams().RPCPort());
|
||||
int defaultPort = gArgs.GetArg("-rpcport", BaseParams().RPCPort());
|
||||
std::vector<std::pair<std::string, uint16_t> > endpoints;
|
||||
|
||||
// Determine what addresses to bind to
|
||||
if (!IsArgSet("-rpcallowip")) { // Default to loopback if not allowing external IPs
|
||||
if (!gArgs.IsArgSet("-rpcallowip")) { // Default to loopback if not allowing external IPs
|
||||
endpoints.push_back(std::make_pair("::1", defaultPort));
|
||||
endpoints.push_back(std::make_pair("127.0.0.1", defaultPort));
|
||||
if (IsArgSet("-rpcbind")) {
|
||||
if (gArgs.IsArgSet("-rpcbind")) {
|
||||
LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n");
|
||||
}
|
||||
} else if (gArgs.IsArgSet("-rpcbind")) { // Specific bind address
|
||||
@@ -369,7 +369,7 @@ bool InitHTTPServer()
|
||||
if (!InitHTTPAllowList())
|
||||
return false;
|
||||
|
||||
if (GetBoolArg("-rpcssl", false)) {
|
||||
if (gArgs.GetBoolArg("-rpcssl", false)) {
|
||||
uiInterface.ThreadSafeMessageBox(
|
||||
"SSL mode for RPC (-rpcssl) is no longer supported.",
|
||||
"", CClientUIInterface::MSG_ERROR);
|
||||
@@ -401,7 +401,7 @@ bool InitHTTPServer()
|
||||
return false;
|
||||
}
|
||||
|
||||
evhttp_set_timeout(http, GetArg("-rpcservertimeout", DEFAULT_HTTP_SERVER_TIMEOUT));
|
||||
evhttp_set_timeout(http, gArgs.GetArg("-rpcservertimeout", DEFAULT_HTTP_SERVER_TIMEOUT));
|
||||
evhttp_set_max_headers_size(http, MAX_HEADERS_SIZE);
|
||||
evhttp_set_max_body_size(http, MAX_SIZE);
|
||||
evhttp_set_gencb(http, http_request_cb, nullptr);
|
||||
@@ -412,7 +412,7 @@ bool InitHTTPServer()
|
||||
}
|
||||
|
||||
LogPrint(BCLog::HTTP, "Initialized HTTP server\n");
|
||||
int workQueueDepth = std::max((long)GetArg("-rpcworkqueue", DEFAULT_HTTP_WORKQUEUE), 1L);
|
||||
int workQueueDepth = std::max((long)gArgs.GetArg("-rpcworkqueue", DEFAULT_HTTP_WORKQUEUE), 1L);
|
||||
LogPrintf("HTTP: creating work queue of depth %d\n", workQueueDepth);
|
||||
|
||||
workQueue = new WorkQueue<HTTPClosure>(workQueueDepth);
|
||||
@@ -442,7 +442,7 @@ std::future<bool> threadResult;
|
||||
bool StartHTTPServer()
|
||||
{
|
||||
LogPrint(BCLog::HTTP, "Starting HTTP server\n");
|
||||
int rpcThreads = std::max((long)GetArg("-rpcthreads", DEFAULT_HTTP_THREADS), 1L);
|
||||
int rpcThreads = std::max((long)gArgs.GetArg("-rpcthreads", DEFAULT_HTTP_THREADS), 1L);
|
||||
LogPrintf("HTTP: starting %d worker threads\n", rpcThreads);
|
||||
std::packaged_task<bool(event_base*, evhttp*)> task(ThreadHTTP);
|
||||
threadResult = task.get_future();
|
||||
|
||||
Reference in New Issue
Block a user