aboutsummaryrefslogtreecommitdiff
path: root/src/rpcnet.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-07-12 00:03:10 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2014-10-14 15:42:01 -0700
commitad6e6017127ec2a3a8d1a71aaab7a6e945c5b0f9 (patch)
tree355891e570b9ad12a522d35a43b707923b9e0ea3 /src/rpcnet.cpp
parent341735eb8f42e898cf9d4d130709471e5d01abe2 (diff)
downloadbitcoin-ad6e6017127ec2a3a8d1a71aaab7a6e945c5b0f9.tar.xz
RPC additions after headers-first
Diffstat (limited to 'src/rpcnet.cpp')
-rw-r--r--src/rpcnet.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/rpcnet.cpp b/src/rpcnet.cpp
index 3bc4bb30c3..12dcd5b540 100644
--- a/src/rpcnet.cpp
+++ b/src/rpcnet.cpp
@@ -97,7 +97,12 @@ Value getpeerinfo(const Array& params, bool fHelp)
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
" \"startingheight\": n, (numeric) The starting height (block) of the peer\n"
" \"banscore\": n, (numeric) The ban score\n"
- " \"syncnode\": true|false (boolean) if sync node\n"
+ " \"synced_headers\": n, (numeric) The last header we have in common with this peer\n"
+ " \"synced_blocks\": n, (numeric) The last block we have in common with this peer\n"
+ " \"inflight\": [\n"
+ " n, (numeric) The heights of blocks we're currently asking from this peer\n"
+ " ...\n"
+ " ]\n"
" }\n"
" ,...\n"
"]\n"
@@ -137,7 +142,13 @@ Value getpeerinfo(const Array& params, bool fHelp)
obj.push_back(Pair("startingheight", stats.nStartingHeight));
if (fStateStats) {
obj.push_back(Pair("banscore", statestats.nMisbehavior));
- obj.push_back(Pair("syncheight", statestats.nSyncHeight));
+ obj.push_back(Pair("synced_headers", statestats.nSyncHeight));
+ obj.push_back(Pair("synced_blocks", statestats.nCommonHeight));
+ Array heights;
+ BOOST_FOREACH(int height, statestats.vHeightInFlight) {
+ heights.push_back(height);
+ }
+ obj.push_back(Pair("inflight", heights));
}
obj.push_back(Pair("whitelisted", stats.fWhitelisted));