aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-04-16 17:51:01 -0400
committerCory Fields <cory-nospam-@coryfields.com>2016-09-08 12:12:57 -0400
commit502dd3a8a0bc0d12744e75f84a22cc12074c5683 (patch)
treecc228980d8a946d02cf3f8203e15e293c43ed7c4
parenta0f3d3cdad630103d919a4ec802c413b87fa1f1a (diff)
net: Add oneshot functions to CConnman
-rw-r--r--src/init.cpp2
-rw-r--r--src/net.cpp5
-rw-r--r--src/net.h4
3 files changed, 5 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index b0ffb7a40e..719b648c04 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1230,7 +1230,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
BOOST_FOREACH(const std::string& strDest, mapMultiArgs["-seednode"])
- AddOneShot(strDest);
+ connman.AddOneShot(strDest);
#if ENABLE_ZMQ
pzmqNotificationInterface = CZMQNotificationInterface::CreateWithArguments(mapArgs);
diff --git a/src/net.cpp b/src/net.cpp
index eeb84fca7a..045939c2ea 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -91,9 +91,6 @@ std::vector<CNode*> vNodes;
CCriticalSection cs_vNodes;
limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ);
-static std::deque<std::string> vOneShots;
-CCriticalSection cs_vOneShots;
-
std::vector<std::string> vAddedNodes;
CCriticalSection cs_vAddedNodes;
@@ -107,7 +104,7 @@ boost::condition_variable messageHandlerCondition;
static CNodeSignals g_signals;
CNodeSignals& GetNodeSignals() { return g_signals; }
-void AddOneShot(const std::string& strDest)
+void CConnman::AddOneShot(const std::string& strDest)
{
LOCK(cs_vOneShots);
vOneShots.push_back(strDest);
diff --git a/src/net.h b/src/net.h
index 65dafb4fd9..81de7f5a98 100644
--- a/src/net.h
+++ b/src/net.h
@@ -87,7 +87,6 @@ unsigned int SendBufferSize();
typedef int NodeId;
-void AddOneShot(const std::string& strDest);
CNode* FindNode(const CNetAddr& ip);
CNode* FindNode(const CSubNet& subNet);
CNode* FindNode(const std::string& addrName);
@@ -137,6 +136,7 @@ public:
void GetBanned(banmap_t &banmap);
void SetBanned(const banmap_t &banmap);
+ void AddOneShot(const std::string& strDest);
private:
struct ListenSocket {
SOCKET socket;
@@ -171,6 +171,8 @@ private:
bool setBannedIsDirty;
bool fAddressesInitialized;
CAddrMan addrman;
+ std::deque<std::string> vOneShots;
+ CCriticalSection cs_vOneShots;
};
extern std::unique_ptr<CConnman> g_connman;
void MapPort(bool fUseUPnP);