aboutsummaryrefslogtreecommitdiff
path: root/src/rpcnet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r--src/rpcnet.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp
index 06ae7070c..1b56d9ae7 100644
--- a/src/rpcnet.cpp
+++ b/src/rpcnet.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2009-2013 The Bitcoin developers
+// Copyright (c) 2009-2014 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
@@ -10,12 +10,6 @@
#include "protocol.h"
#include "sync.h"
#include "util.h"
-#ifdef ENABLE_WALLET
-#include "init.h" // for getinfo
-#include "wallet.h" // for getinfo
-#endif
-
-#include <inttypes.h>
#include <boost/foreach.hpp>
#include "json/json_spirit_value.h"
@@ -47,7 +41,7 @@ Value ping(const Array& params, bool fHelp)
"ping\n"
"\nRequests that a ping be sent to all other nodes, to measure ping time.\n"
"Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.\n"
- "Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping."
+ "Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.\n"
"\nExamples:\n"
+ HelpExampleCli("ping", "")
+ HelpExampleRpc("ping", "")
@@ -121,7 +115,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
obj.push_back(Pair("addr", stats.addrName));
if (!(stats.addrLocal.empty()))
obj.push_back(Pair("addrlocal", stats.addrLocal));
- obj.push_back(Pair("services", strprintf("%08"PRIx64, stats.nServices)));
+ obj.push_back(Pair("services", strprintf("%08x", stats.nServices)));
obj.push_back(Pair("lastsend", (boost::int64_t)stats.nLastSend));
obj.push_back(Pair("lastrecv", (boost::int64_t)stats.nLastRecv));
obj.push_back(Pair("bytessent", (boost::int64_t)stats.nSendBytes));
@@ -140,8 +134,7 @@ Value getpeerinfo(const Array& params, bool fHelp)
if (fStateStats) {
obj.push_back(Pair("banscore", statestats.nMisbehavior));
}
- if (stats.fSyncNode)
- obj.push_back(Pair("syncnode", true));
+ obj.push_back(Pair("syncnode", stats.fSyncNode));
ret.push_back(obj);
}
@@ -255,16 +248,18 @@ Value getaddednodeinfo(const Array& params, bool fHelp)
throw JSONRPCError(RPC_CLIENT_NODE_NOT_ADDED, "Error: Node has not been added.");
}
+ Array ret;
if (!fDns)
{
- Object ret;
BOOST_FOREACH(string& strAddNode, laddedNodes)
- ret.push_back(Pair("addednode", strAddNode));
+ {
+ Object obj;
+ obj.push_back(Pair("addednode", strAddNode));
+ ret.push_back(obj);
+ }
return ret;
}
- Array ret;
-
list<pair<string, vector<CService> > > laddedAddreses(0);
BOOST_FOREACH(string& strAddNode, laddedNodes)
{