aboutsummaryrefslogtreecommitdiff
path: root/src/rpcnet.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-06-21 13:34:36 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-07-09 20:40:14 +0200
commitdc942e6f276b9fabc21f06d11cd16871d4054f82 (patch)
tree5ccbf11f0aec355fe115a606bb370125bb631d98 /src/rpcnet.cpp
parentf3330b40a599615f15f585166ef08f00d06e9616 (diff)
downloadbitcoin-dc942e6f276b9fabc21f06d11cd16871d4054f82.tar.xz
Introduce whitelisted peers.
This adds a -whitelist option to specify subnet ranges from which peers that connect are whitelisted. In addition, there is a -whitebind option which works like -bind, except peers connecting to it are also whitelisted (allowing a separate listen port for trusted connections). Being whitelisted has two effects (for now): * They are immune to DoS disconnection/banning. * Transactions they broadcast (which are valid) are always relayed, even if they were already in the mempool. This means that a node can function as a gateway for a local network, and that rebroadcasts from the local network will work as expected. Whitelisting replaces the magic exemption localhost had for DoS disconnection (local addresses are still never banned, though), which implied hidden service connects (from a localhost Tor node) were incorrectly immune to DoS disconnection as well. This old behaviour is removed for that reason, but can be restored using -whitelist=127.0.0.1 or -whitelist=::1 can be specified. -whitebind is safer to use in case non-trusted localhost connections are expected (like hidden services).
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r--src/rpcnet.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp
index cf2c293caf..680717930b 100644
--- a/src/rpcnet.cpp
+++ b/src/rpcnet.cpp
@@ -137,6 +137,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
obj.push_back(Pair("syncheight", statestats.nSyncHeight));
}
obj.push_back(Pair("syncnode", stats.fSyncNode));
+ obj.push_back(Pair("whitelisted", stats.fWhitelisted));
ret.push_back(obj);
}