diff options
| author | Eric Lombrozo <[email protected]> | 2014-10-19 04:46:17 -0400 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-01-28 07:41:54 +0100 |
| commit | 4401b2d7c52e0f3841225369fb0d10767c51aaa2 (patch) | |
| tree | 29b0b989569f1a16cba69c287a30e0db220343b6 /src/rpcnet.cpp | |
| parent | Merge pull request #5506 (diff) | |
| download | discoin-4401b2d7c52e0f3841225369fb0d10767c51aaa2.tar.xz discoin-4401b2d7c52e0f3841225369fb0d10767c51aaa2.zip | |
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.
Diffstat (limited to 'src/rpcnet.cpp')
| -rw-r--r-- | src/rpcnet.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp index f0fadb598..6306fd440 100644 --- a/src/rpcnet.cpp +++ b/src/rpcnet.cpp @@ -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", |