mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Add mediantime field to getblockchaininfo RPC call
Useful now that BIP113 is enforced for transactions entering the mempool. Was previously only (indirectly) available by calling getblocktemplate, a relatively expensive RPC call.
This commit is contained in:
parent
dbd2c135dd
commit
748321eb5b
@ -639,6 +639,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
|||||||
obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1));
|
obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1));
|
||||||
obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex()));
|
obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex()));
|
||||||
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
|
obj.push_back(Pair("difficulty", (double)GetDifficulty()));
|
||||||
|
obj.push_back(Pair("mediantime", (int64_t)chainActive.Tip()->GetMedianTimePast()));
|
||||||
obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(Params().Checkpoints(), chainActive.Tip())));
|
obj.push_back(Pair("verificationprogress", Checkpoints::GuessVerificationProgress(Params().Checkpoints(), chainActive.Tip())));
|
||||||
obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex()));
|
obj.push_back(Pair("chainwork", chainActive.Tip()->nChainWork.GetHex()));
|
||||||
obj.push_back(Pair("pruned", fPruneMode));
|
obj.push_back(Pair("pruned", fPruneMode));
|
||||||
|
Loading…
Reference in New Issue
Block a user