aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2021-03-01 21:35:28 +0100
committerJon Atack <jon@atack.com>2021-03-16 19:52:31 +0100
commit6423c8175fad3163c10ffdb49e0df48e4e4931f1 (patch)
treefe0ad5daa524b4802c6e2d60bcb80043d245d876 /src/httpserver.cpp
parent1b6c463e033f861561d1a46ccf7eec069bbac09f (diff)
downloadbitcoin-6423c8175fad3163c10ffdb49e0df48e4e4931f1.tar.xz
p2p, refactor: pass and use uint16_t CService::port as uint16_t
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r--src/httpserver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 0a8e58ab67..e1c8ec4ab9 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -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));