aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/chainparams.h')
-rw-r--r--src/chainparams.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/chainparams.h b/src/chainparams.h
index d8b25c7220..4d24dcdb7c 100644
--- a/src/chainparams.h
+++ b/src/chainparams.h
@@ -31,6 +31,26 @@ struct CCheckpointData {
};
/**
+ * Holds configuration for use during UTXO snapshot load and validation. The contents
+ * here are security critical, since they dictate which UTXO snapshots are recognized
+ * as valid.
+ */
+struct AssumeutxoData {
+ //! The expected hash of the deserialized UTXO set.
+ const uint256 hash_serialized;
+
+ //! Used to populate the nChainTx value, which is used during BlockManager::LoadBlockIndex().
+ //!
+ //! We need to hardcode the value here because this is computed cumulatively using block data,
+ //! which we do not necessarily have at the time of snapshot load.
+ const unsigned int nChainTx;
+};
+
+std::ostream& operator<<(std::ostream& o, const AssumeutxoData& aud);
+
+using MapAssumeutxo = std::map<int, const AssumeutxoData>;
+
+/**
* Holds various statistics on transactions within a chain. Used to estimate
* verification progress during chain sync.
*
@@ -90,6 +110,11 @@ public:
const std::string& Bech32HRP() const { return bech32_hrp; }
const std::vector<SeedSpec6>& FixedSeeds() const { return vFixedSeeds; }
const CCheckpointData& Checkpoints() const { return checkpointData; }
+
+ //! Get allowed assumeutxo configuration.
+ //! @see ChainstateManager
+ const MapAssumeutxo& Assumeutxo() const { return m_assumeutxo_data; }
+
const ChainTxData& TxData() const { return chainTxData; }
protected:
CChainParams() {}
@@ -111,6 +136,7 @@ protected:
bool m_is_test_chain;
bool m_is_mockable_chain;
CCheckpointData checkpointData;
+ MapAssumeutxo m_assumeutxo_data;
ChainTxData chainTxData;
};