mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
p2p, refactor: pass and use uint16_t CService::port as uint16_t
This commit is contained in:
parent
1b6c463e03
commit
6423c8175f
17 changed files with 48 additions and 47 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue