aboutsummaryrefslogtreecommitdiff
path: root/src/node/coinstats.h
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-03-28 11:41:01 -0400
committerJames O'Beirne <james.obeirne@gmail.com>2019-08-27 11:51:56 -0400
commit8a3b2eb17572ca2131778d52cc25ec359470a90f (patch)
treec651ebf44320e96af435fcf180a11de3472e670c /src/node/coinstats.h
parentadff8fe32101b2c007a85415c3ec565a7f137252 (diff)
downloadbitcoin-8a3b2eb17572ca2131778d52cc25ec359470a90f.tar.xz
move-only: move coins statistics utils out of RPC
These procedures will later be used in the ChainstateManager to compute statistics (particularly a content hash) for UTXO sets coming in from snapshots.
Diffstat (limited to 'src/node/coinstats.h')
-rw-r--r--src/node/coinstats.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/node/coinstats.h b/src/node/coinstats.h
new file mode 100644
index 0000000000..7c11aab8bd
--- /dev/null
+++ b/src/node/coinstats.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2010 Satoshi Nakamoto
+// Copyright (c) 2009-2019 The Bitcoin Core developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef BITCOIN_NODE_COINSTATS_H
+#define BITCOIN_NODE_COINSTATS_H
+
+#include <amount.h>
+#include <uint256.h>
+
+#include <cstdint>
+
+class CCoinsView;
+
+struct CCoinsStats
+{
+ int nHeight;
+ uint256 hashBlock;
+ uint64_t nTransactions;
+ uint64_t nTransactionOutputs;
+ uint64_t nBogoSize;
+ uint256 hashSerialized;
+ uint64_t nDiskSize;
+ CAmount nTotalAmount;
+
+ CCoinsStats() : nHeight(0), nTransactions(0), nTransactionOutputs(0), nBogoSize(0), nDiskSize(0), nTotalAmount(0) {}
+};
+
+//! Calculate statistics about the unspent transaction output set
+bool GetUTXOStats(CCoinsView* view, CCoinsStats& stats);
+
+#endif // BITCOIN_NODE_COINSTATS_H