aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-04-17 20:20:34 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 12:24:06 -0400
commit551e0887db9034b1e6490a267ba864b1d26ff469 (patch)
treec2e305d10dd06a3f33242e3b72c61d25b48e0dcc /src/net.h
parent6c19d92361fe4afb26dfa5d48a0748b84bca6f12 (diff)
downloadbitcoin-551e0887db9034b1e6490a267ba864b1d26ff469.tar.xz
net: move nLastNodeId to CConnman
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/net.h b/src/net.h
index 8d9925265d..36043b0b8c 100644
--- a/src/net.h
+++ b/src/net.h
@@ -196,6 +196,9 @@ private:
bool IsWhitelistedRange(const CNetAddr &addr);
void DeleteNode(CNode* pnode);
+
+ NodeId GetNewNodeId();
+
//!check is the banlist has unwritten changes
bool BannedSetIsDirty();
//!set the "dirty" flag for the banlist
@@ -223,6 +226,7 @@ private:
CCriticalSection cs_vAddedNodes;
std::vector<CNode*> vNodes;
mutable CCriticalSection cs_vNodes;
+ std::atomic<NodeId> nLastNodeId;
};
extern std::unique_ptr<CConnman> g_connman;
void MapPort(bool fUseUPnP);
@@ -300,9 +304,6 @@ extern int nMaxConnections;
extern limitedmap<uint256, int64_t> mapAlreadyAskedFor;
-extern NodeId nLastNodeId;
-extern CCriticalSection cs_nLastNodeId;
-
/** Subversion as sent to the P2P network in `version` messages */
extern std::string strSubVersion;
@@ -501,7 +502,7 @@ public:
CAmount lastSentFeeFilter;
int64_t nextSendTimeFeeFilter;
- CNode(SOCKET hSocketIn, const CAddress &addrIn, const std::string &addrNameIn = "", bool fInboundIn = false);
+ CNode(NodeId id, SOCKET hSocketIn, const CAddress &addrIn, const std::string &addrNameIn = "", bool fInboundIn = false);
~CNode();
private: