aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-07-10 15:06:50 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2015-07-10 15:07:15 +0200
commit445220544e05d36a47f03d94181e00c52e65a4d6 (patch)
tree996bc2d9546234029fc570740c2d35a7c30d8f7a /src/net.h
parent708037fcc776838b4e3a6d0c511aeff09c15a8e9 (diff)
parente3cae525382520ddbef92bf86f43eaf0521f4325 (diff)
downloadbitcoin-445220544e05d36a47f03d94181e00c52e65a4d6.tar.xz
Merge pull request #5288
e3cae52 Added -whiteconnections=<n> option (Josh Lehan)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index f15b85474f..86d74e2174 100644
--- a/src/net.h
+++ b/src/net.h
@@ -141,7 +141,20 @@ extern bool fListen;
extern uint64_t nLocalServices;
extern uint64_t nLocalHostNonce;
extern CAddrMan addrman;
+
+// The allocation of connections against the maximum allowed (nMaxConnections)
+// is prioritized as follows:
+// 1st: Outbound connections (MAX_OUTBOUND_CONNECTIONS)
+// 2nd: Inbound connections from whitelisted peers (nWhiteConnections)
+// 3rd: Inbound connections from non-whitelisted peers
+// Thus, the number of connection slots for the general public to use is:
+// nMaxConnections - (MAX_OUTBOUND_CONNECTIONS + nWhiteConnections)
+// Any additional inbound connections beyond limits will be immediately closed
+
+/** Maximum number of connections to simultaneously allow (aka connection slots) */
extern int nMaxConnections;
+/** Number of connection slots to reserve for inbound from whitelisted peers */
+extern int nWhiteConnections;
extern std::vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;