mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
p2p, refactor: pass and use uint16_t CService::port as uint16_t
This commit is contained in:
@@ -290,8 +290,8 @@ static bool ThreadHTTP(struct event_base* base)
|
||||
/** Bind HTTP server to specified addresses */
|
||||
static bool HTTPBindAddresses(struct evhttp* http)
|
||||
{
|
||||
int http_port = gArgs.GetArg("-rpcport", BaseParams().RPCPort());
|
||||
std::vector<std::pair<std::string, uint16_t> > endpoints;
|
||||
uint16_t http_port{static_cast<uint16_t>(gArgs.GetArg("-rpcport", BaseParams().RPCPort()))};
|
||||
std::vector<std::pair<std::string, uint16_t>> endpoints;
|
||||
|
||||
// Determine what addresses to bind to
|
||||
if (!(gArgs.IsArgSet("-rpcallowip") && gArgs.IsArgSet("-rpcbind"))) { // Default to loopback if not allowing external IPs
|
||||
@@ -305,7 +305,7 @@ static bool HTTPBindAddresses(struct evhttp* http)
|
||||
}
|
||||
} else if (gArgs.IsArgSet("-rpcbind")) { // Specific bind address
|
||||
for (const std::string& strRPCBind : gArgs.GetArgs("-rpcbind")) {
|
||||
int port = http_port;
|
||||
uint16_t port{http_port};
|
||||
std::string host;
|
||||
SplitHostPort(strRPCBind, port, host);
|
||||
endpoints.push_back(std::make_pair(host, port));
|
||||
|
||||
Reference in New Issue
Block a user