Skip to content

Commit 15a219f

Browse files
committed
Merge #14628: Trivial: Rename misleading 'defaultPort' to 'rpc_port'
4ed7308 scripted-diff: Rename misleading 'defaultPort' to 'http_port' (Murray Nesbitt) Pull request description: `defaultPort` in `HTTPBindAddresses()` is misleadingly named. `defaultPort ` suggests a constant, not something that might be overridden by `-rpcport`. Tree-SHA512: f6ae8bdc2b4a4f503e44df9efdec32c854d2dede87714399f53791d50cce6bc41c46b01d1583cfc0e3e4777c244e1c74443fa39d9da50a45e53af265b74a17d1
2 parents 46eb275 + 4ed7308 commit 15a219f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/httpserver.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,26 +292,26 @@ static bool ThreadHTTP(struct event_base* base)
292292
/** Bind HTTP server to specified addresses */
293293
static bool HTTPBindAddresses(struct evhttp* http)
294294
{
295-
int defaultPort = gArgs.GetArg("-rpcport", BaseParams().RPCPort());
295+
int http_port = gArgs.GetArg("-rpcport", BaseParams().RPCPort());
296296
std::vector<std::pair<std::string, uint16_t> > endpoints;
297297

298298
// Determine what addresses to bind to
299299
if (!gArgs.IsArgSet("-rpcallowip")) { // Default to loopback if not allowing external IPs
300-
endpoints.push_back(std::make_pair("::1", defaultPort));
301-
endpoints.push_back(std::make_pair("127.0.0.1", defaultPort));
300+
endpoints.push_back(std::make_pair("::1", http_port));
301+
endpoints.push_back(std::make_pair("127.0.0.1", http_port));
302302
if (gArgs.IsArgSet("-rpcbind")) {
303303
LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n");
304304
}
305305
} else if (gArgs.IsArgSet("-rpcbind")) { // Specific bind address
306306
for (const std::string& strRPCBind : gArgs.GetArgs("-rpcbind")) {
307-
int port = defaultPort;
307+
int port = http_port;
308308
std::string host;
309309
SplitHostPort(strRPCBind, port, host);
310310
endpoints.push_back(std::make_pair(host, port));
311311
}
312312
} else { // No specific bind address specified, bind to any
313-
endpoints.push_back(std::make_pair("::", defaultPort));
314-
endpoints.push_back(std::make_pair("0.0.0.0", defaultPort));
313+
endpoints.push_back(std::make_pair("::", http_port));
314+
endpoints.push_back(std::make_pair("0.0.0.0", http_port));
315315
}
316316

317317
// Bind addresses

0 commit comments

Comments
 (0)