mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 18:53:21 +01:00
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:
committed by
Wladimir J. van der Laan
parent
6b5f5294bb
commit
4401b2d7c5
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user