diff options
author | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-04-24 22:12:06 +0200 |
---|---|---|
committer | Jonas Schnelli <jonas.schnelli@include7.ch> | 2015-04-26 23:23:09 +0200 |
commit | 1b2e555593ed2fade74657355e13fbad2f0b552c (patch) | |
tree | 6abcbb47502cb906b020fc9f43449f42b8115361 | |
parent | 1623f6e3375430b42e7120dc02e8df8c7c22fc16 (diff) |
add autoprune information to RPC "getblockchaininfo"
-rw-r--r-- | src/rpcblockchain.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 293d6d5619..d8771d1dd5 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -492,6 +492,15 @@ Value getblockchaininfo(const Array& params, bool fHelp) obj.push_back(Pair("difficulty", (double)GetDifficulty())); obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(chainActive.Tip()))); obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex())); + obj.push_back(Pair("pruned", fPruneMode)); + if (fPruneMode) + { + CBlockIndex *block = chainActive.Tip(); + while (block && block->pprev && (block->pprev->nStatus & BLOCK_HAVE_DATA)) + block = block->pprev; + + obj.push_back(Pair("pruneheight", block->nHeight)); + } return obj; } |