Merge pull request #921 from letolabs/size_on_disk
Add size_on_disk to getblockchaininfo from BTC master
This commit is contained in:
@@ -916,6 +916,8 @@ extern CBlockTreeDB *pblocktree;
|
|||||||
*/
|
*/
|
||||||
int GetSpendHeight(const CCoinsViewCache& inputs);
|
int GetSpendHeight(const CCoinsViewCache& inputs);
|
||||||
|
|
||||||
|
uint64_t CalculateCurrentUsage();
|
||||||
|
|
||||||
/** Return a CMutableTransaction with contextual default values based on set of consensus rules at height */
|
/** Return a CMutableTransaction with contextual default values based on set of consensus rules at height */
|
||||||
CMutableTransaction CreateNewContextualCMutableTransaction(const Consensus::Params& consensusParams, int nHeight);
|
CMutableTransaction CreateNewContextualCMutableTransaction(const Consensus::Params& consensusParams, int nHeight);
|
||||||
|
|
||||||
|
|||||||
@@ -1253,6 +1253,7 @@ void NetworkUpgradeDescPushBack(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
if (fHelp || params.size() != 0)
|
if (fHelp || params.size() != 0)
|
||||||
@@ -1270,6 +1271,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
|||||||
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
|
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
|
||||||
" \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n"
|
" \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n"
|
||||||
" \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n"
|
" \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n"
|
||||||
|
" \"size_on_disk\": xxxxxx, (numeric) the estimated size of the block and undo files on disk\n"
|
||||||
" \"commitments\": xxxxxx, (numeric) the current number of note commitments in the commitment tree\n"
|
" \"commitments\": xxxxxx, (numeric) the current number of note commitments in the commitment tree\n"
|
||||||
" \"softforks\": [ (array) status of softforks in progress\n"
|
" \"softforks\": [ (array) status of softforks in progress\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
@@ -1319,6 +1321,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
|||||||
obj.push_back(Pair("verificationprogress", progress));
|
obj.push_back(Pair("verificationprogress", progress));
|
||||||
obj.push_back(Pair("chainwork", chainActive.LastTip()->nChainWork.GetHex()));
|
obj.push_back(Pair("chainwork", chainActive.LastTip()->nChainWork.GetHex()));
|
||||||
obj.push_back(Pair("pruned", fPruneMode));
|
obj.push_back(Pair("pruned", fPruneMode));
|
||||||
|
obj.push_back(Pair("size_on_disk", CalculateCurrentUsage()));
|
||||||
|
|
||||||
ZCIncrementalMerkleTree tree;
|
ZCIncrementalMerkleTree tree;
|
||||||
pcoinsTip->GetAnchorAt(pcoinsTip->GetBestAnchor(), tree);
|
pcoinsTip->GetAnchorAt(pcoinsTip->GetBestAnchor(), tree);
|
||||||
|
|||||||
Reference in New Issue
Block a user