aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2012-06-29 17:34:02 -0700
committerGavin Andresen <[email protected]>2012-06-29 17:34:02 -0700
commit3a906d45dc4ed9b6ac5f8422c41e07767b557cb6 (patch)
tree2428f40e938a18a376a355fe31722b6ed606ccf0 /src/bitcoinrpc.cpp
parentMerge pull request #1537 from Diapolo/fix_awesome_typo (diff)
parentRPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode data (diff)
downloaddiscoin-3a906d45dc4ed9b6ac5f8422c41e07767b557cb6.tar.xz
discoin-3a906d45dc4ed9b6ac5f8422c41e07767b557cb6.zip
Merge pull request #1531 from jgarzik/peerinfo
RPC: add 'getpeerinfo', returning easy-to-retrieve per-CNode data
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index de6db5398..51690243b 100644
--- a/src/bitcoinrpc.cpp
+++ b/src/bitcoinrpc.cpp
@@ -46,6 +46,8 @@ static std::string strRPCUserColonPass;
static int64 nWalletUnlockTime;
static CCriticalSection cs_nWalletUnlockTime;
+extern Value getconnectioncount(const Array& params, bool fHelp);
+extern Value getpeerinfo(const Array& params, bool fHelp);
extern Value dumpprivkey(const Array& params, bool fHelp);
extern Value importprivkey(const Array& params, bool fHelp);
@@ -456,17 +458,6 @@ Value getblockcount(const Array& params, bool fHelp)
}
-Value getconnectioncount(const Array& params, bool fHelp)
-{
- if (fHelp || params.size() != 0)
- throw runtime_error(
- "getconnectioncount\n"
- "Returns the number of connections to other nodes.");
-
- return (int)vNodes.size();
-}
-
-
Value getdifficulty(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
@@ -2310,6 +2301,7 @@ static const CRPCCommand vRPCCommands[] =
{ "stop", &stop, true },
{ "getblockcount", &getblockcount, true },
{ "getconnectioncount", &getconnectioncount, true },
+ { "getpeerinfo", &getpeerinfo, true },
{ "getdifficulty", &getdifficulty, true },
{ "getgenerate", &getgenerate, true },
{ "setgenerate", &setgenerate, true },