@@ -292,26 +292,26 @@ static bool ThreadHTTP(struct event_base* base)
292
292
/* * Bind HTTP server to specified addresses */
293
293
static bool HTTPBindAddresses (struct evhttp * http)
294
294
{
295
- int defaultPort = gArgs .GetArg (" -rpcport" , BaseParams ().RPCPort ());
295
+ int http_port = gArgs .GetArg (" -rpcport" , BaseParams ().RPCPort ());
296
296
std::vector<std::pair<std::string, uint16_t > > endpoints;
297
297
298
298
// Determine what addresses to bind to
299
299
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 ));
302
302
if (gArgs .IsArgSet (" -rpcbind" )) {
303
303
LogPrintf (" WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n " );
304
304
}
305
305
} else if (gArgs .IsArgSet (" -rpcbind" )) { // Specific bind address
306
306
for (const std::string& strRPCBind : gArgs .GetArgs (" -rpcbind" )) {
307
- int port = defaultPort ;
307
+ int port = http_port ;
308
308
std::string host;
309
309
SplitHostPort (strRPCBind, port, host);
310
310
endpoints.push_back (std::make_pair (host, port));
311
311
}
312
312
} 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 ));
315
315
}
316
316
317
317
// Bind addresses
0 commit comments