aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2017-01-06 07:47:05 -0800
committerPieter Wuille <pieter.wuille@gmail.com>2017-01-06 08:37:47 -0800
commita55716abe5662ec74c2f8af93023f1e7cca901fc (patch)
treee216baea04fc64b78e69a24ca404cff0241951b6 /src/net.h
parentf646275b90b1de93bc62b4c4d045d75ac0b96eee (diff)
parent032ba3f0665432bd15ff76ee01cde245ad29e3e6 (diff)
downloadbitcoin-a55716abe5662ec74c2f8af93023f1e7cca901fc.tar.xz
Merge #9319: Break addnode out from the outbound connection limits.
032ba3f RPC help documentation for addnode peerinfo. (Gregory Maxwell) 90f13e1 Add release notes for addnode changes. (Gregory Maxwell) 50bd12c Break addnode out from the outbound connection limits. (Gregory Maxwell)
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/net.h b/src/net.h
index 6ca402f71d..97b27dcdf4 100644
--- a/src/net.h
+++ b/src/net.h
@@ -58,8 +58,10 @@ static const unsigned int MAX_ADDR_TO_SEND = 1000;
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 4 * 1000 * 1000;
/** Maximum length of strSubVer in `version` message */
static const unsigned int MAX_SUBVERSION_LENGTH = 256;
-/** Maximum number of outgoing nodes */
+/** Maximum number of automatic outgoing nodes */
static const int MAX_OUTBOUND_CONNECTIONS = 8;
+/** Maximum number of addnode outgoing nodes */
+static const int MAX_ADDNODE_CONNECTIONS = 8;
/** -listen default */
static const bool DEFAULT_LISTEN = true;
/** -upnp default */
@@ -135,6 +137,7 @@ public:
ServiceFlags nRelevantServices = NODE_NONE;
int nMaxConnections = 0;
int nMaxOutbound = 0;
+ int nMaxAddnode = 0;
int nMaxFeeler = 0;
int nBestHeight = 0;
CClientUIInterface* uiInterface = nullptr;
@@ -151,7 +154,7 @@ public:
bool BindListenPort(const CService &bindAddr, std::string& strError, bool fWhitelisted = false);
bool GetNetworkActive() const { return fNetworkActive; };
void SetNetworkActive(bool active);
- bool OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false, bool fFeeler = false);
+ bool OpenNetworkConnection(const CAddress& addrConnect, bool fCountFailure, CSemaphoreGrant *grantOutbound = NULL, const char *strDest = NULL, bool fOneShot = false, bool fFeeler = false, bool fAddnode = false);
bool CheckIncomingNonce(uint64_t nonce);
bool ForNode(NodeId id, std::function<bool(CNode* pnode)> func);
@@ -414,8 +417,10 @@ private:
ServiceFlags nRelevantServices;
CSemaphore *semOutbound;
+ CSemaphore *semAddnode;
int nMaxConnections;
int nMaxOutbound;
+ int nMaxAddnode;
int nMaxFeeler;
std::atomic<int> nBestHeight;
CClientUIInterface* clientInterface;
@@ -529,6 +534,7 @@ public:
int nVersion;
std::string cleanSubVer;
bool fInbound;
+ bool fAddnode;
int nStartingHeight;
uint64_t nSendBytes;
mapMsgCmdSize mapSendBytesPerMsgCmd;
@@ -626,6 +632,7 @@ public:
bool fWhitelisted; // This peer can bypass DoS banning.
bool fFeeler; // If true this node is being used as a short lived feeler.
bool fOneShot;
+ bool fAddnode;
bool fClient;
const bool fInbound;
bool fSuccessfullyConnected;