add autoprune information to RPC "getblockchaininfo"
This commit is contained in:
parent
1623f6e337
commit
1b2e555593
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue