aboutsummaryrefslogtreecommitdiff
path: root/src/node/coinstats.cpp
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-03-28 12:09:06 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2019-11-05 10:54:00 -0500
commit92fafb3a7da66f737e960e541fcfbcadedf6043a (patch)
treedfb8740306736532fb514f1e0076d5716d673e7f /src/node/coinstats.cpp
parent707fde7b9ba522c22179e2db0ed7b462c65138d9 (diff)
coinstats: add coins_count
Also changes existing CCoinsStats attributes to be C++11 initialized.
Diffstat (limited to 'src/node/coinstats.cpp')
-rw-r--r--src/node/coinstats.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node/coinstats.cpp b/src/node/coinstats.cpp
index 57fa158ad2..23269cd4b0 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<CCoinsViewCursor> 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__);
}