net: move nLastNodeId to CConnman

This commit is contained in:
Cory Fields
2016-04-17 20:20:34 -04:00
parent 6c19d92361
commit 551e0887db
4 changed files with 25 additions and 23 deletions

View File

@@ -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: