From 92fafb3a7da66f737e960e541fcfbcadedf6043a Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Thu, 28 Mar 2019 12:09:06 -0400 Subject: coinstats: add coins_count Also changes existing CCoinsStats attributes to be C++11 initialized. --- src/node/coinstats.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/node/coinstats.cpp') diff --git a/src/node/coinstats.cpp b/src/node/coinstats.cpp index 57fa158ad..23269cd4b 100644 --- a/src/node/coinstats.cpp +++ b/src/node/coinstats.cpp @@ -38,6 +38,7 @@ static void ApplyStats(CCoinsStats &stats, CHashWriter& ss, const uint256& hash, //! Calculate statistics about the unspent transaction output set bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats) { + stats = CCoinsStats(); std::unique_ptr pcursor(view->Cursor()); assert(pcursor); @@ -61,6 +62,7 @@ bool GetUTXOStats(CCoinsView *view, CCoinsStats &stats) } prevkey = key.hash; outputs[key.n] = std::move(coin); + stats.coins_count++; } else { return error("%s: unable to read value", __func__); } -- cgit v1.2.3