aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2018-10-20 14:37:18 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2018-11-22 01:44:59 +0000
commit3615003952ffbc814bdb53d9d0e45790f152bd2f (patch)
treefd0c7a26ca69d66b01ec77eac7238f8078d29838 /src/httpserver.cpp
parentd7b0258ff037ae90f60a86fc68cb55069c96e8d0 (diff)
downloadbitcoin-3615003952ffbc814bdb53d9d0e45790f152bd2f.tar.xz
net: Always default rpcbind to localhost, never "all interfaces"
We don't support binding to untrusted networks, so avoid a default where that is typical
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r--src/httpserver.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 91ebc4680c..cf365f4638 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -300,9 +300,12 @@ static bool HTTPBindAddresses(struct evhttp* http)
std::vector<std::pair<std::string, uint16_t> > endpoints;
// Determine what addresses to bind to
- if (!gArgs.IsArgSet("-rpcallowip")) { // Default to loopback if not allowing external IPs
+ if (!(gArgs.IsArgSet("-rpcallowip") && gArgs.IsArgSet("-rpcbind"))) { // Default to loopback if not allowing external IPs
endpoints.push_back(std::make_pair("::1", http_port));
endpoints.push_back(std::make_pair("127.0.0.1", http_port));
+ if (gArgs.IsArgSet("-rpcallowip")) {
+ LogPrintf("WARNING: option -rpcallowip was specified without -rpcbind; this doesn't usually make sense\n");
+ }
if (gArgs.IsArgSet("-rpcbind")) {
LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n");
}
@@ -313,9 +316,6 @@ static bool HTTPBindAddresses(struct evhttp* http)
SplitHostPort(strRPCBind, port, host);
endpoints.push_back(std::make_pair(host, port));
}
- } else { // No specific bind address specified, bind to any
- endpoints.push_back(std::make_pair("::", http_port));
- endpoints.push_back(std::make_pair("0.0.0.0", http_port));
}
// Bind addresses