From e31aa7c9d7dd204b5658f20c19565eee308e35c1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Wed, 1 May 2013 16:23:27 +0200 Subject: Improve gettxoutsetinfo command * Bugfix: output the correct best block hash (during IBD, it can differ from the actual current best block) * Add height to output * Add hash_serialized, which is a hash of the entire UTXO state. Can be useful to compare two nodes. * Add total_amount, the sum of all UTXOs' values. --- src/rpcblockchain.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/rpcblockchain.cpp') diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 2200679050..11af1abf5d 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -172,10 +172,13 @@ Value gettxoutsetinfo(const Array& params, bool fHelp) CCoinsStats stats; if (pcoinsTip->GetStats(stats)) { - ret.push_back(Pair("bestblock", pcoinsTip->GetBestBlock()->GetBlockHash().GetHex())); + ret.push_back(Pair("height", (boost::int64_t)stats.nHeight)); + ret.push_back(Pair("bestblock", stats.hashBlock.GetHex())); ret.push_back(Pair("transactions", (boost::int64_t)stats.nTransactions)); ret.push_back(Pair("txouts", (boost::int64_t)stats.nTransactionOutputs)); ret.push_back(Pair("bytes_serialized", (boost::int64_t)stats.nSerializedSize)); + ret.push_back(Pair("hash_serialized", stats.hashSerialized.GetHex())); + ret.push_back(Pair("total_amount", ValueFromAmount(stats.nTotalAmount))); } return ret; } -- cgit v1.2.3