@@ -292,26 +292,26 @@ static bool ThreadHTTP(struct event_base* base)
292292/* * Bind HTTP server to specified addresses */
293293static 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