From ad6e6017127ec2a3a8d1a71aaab7a6e945c5b0f9 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 12 Jul 2014 00:03:10 +0200 Subject: RPC additions after headers-first --- src/rpcblockchain.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/rpcblockchain.cpp') diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 24175215bf..5beac0512a 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -445,6 +445,7 @@ Value getblockchaininfo(const Array& params, bool fHelp) "{\n" " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" + " \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n" " \"bestblockhash\": \"...\", (string) the hash of the currently best block\n" " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n" @@ -458,6 +459,7 @@ Value getblockchaininfo(const Array& params, bool fHelp) Object obj; obj.push_back(Pair("chain", Params().NetworkIDString())); obj.push_back(Pair("blocks", (int)chainActive.Height())); + obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1)); obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex())); obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(chainActive.Tip()))); -- cgit v1.2.3