Removed main.h dependency from rpcserver.cpp

Rebased by @laanwj:

- update for RPC methods added since 84d13ee: setmocktime,
  invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
  the other two are thread safe.
This commit is contained in:
Eric Lombrozo
2014-10-19 04:46:17 -04:00
committed by Wladimir J. van der Laan
parent 6b5f5294bb
commit 4401b2d7c5
11 changed files with 224 additions and 38 deletions

View File

@@ -34,7 +34,8 @@ Value getconnectioncount(const Array& params, bool fHelp)
+ HelpExampleRpc("getconnectioncount", "")
);
LOCK(cs_vNodes);
LOCK2(cs_main, cs_vNodes);
return (int)vNodes.size();
}
@@ -52,7 +53,8 @@ Value ping(const Array& params, bool fHelp)
);
// Request that each node send a ping during next message processing pass
LOCK(cs_vNodes);
LOCK2(cs_main, cs_vNodes);
BOOST_FOREACH(CNode* pNode, vNodes) {
pNode->fPingQueued = true;
}
@@ -113,6 +115,8 @@ Value getpeerinfo(const Array& params, bool fHelp)
+ HelpExampleRpc("getpeerinfo", "")
);
LOCK(cs_main);
vector<CNodeStats> vstats;
CopyNodeStats(vstats);
@@ -411,6 +415,8 @@ Value getnetworkinfo(const Array& params, bool fHelp)
+ HelpExampleRpc("getnetworkinfo", "")
);
LOCK(cs_main);
Object obj;
obj.push_back(Pair("version", CLIENT_VERSION));
obj.push_back(Pair("subversion",