|
|
|
@ -492,6 +492,15 @@ Value getblockchaininfo(const Array& params, bool fHelp)
@@ -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; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|