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
1 changed files with 1 additions and 0 deletions
|
@ -639,6 +639,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp)
|
|||
obj.push_back(Pair("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1));
|
||||
obj.push_back(Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex()));
|
||||
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("chainwork", chainActive.Tip()->nChainWork.GetHex()));
|
||||
obj.push_back(Pair("pruned", fPruneMode));
|
||||
|
|
Loading…
Reference in a new issue