diff --git a/src/Makefile.am b/src/Makefile.am index 41fab024c6fe4..770bb76226a8b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -246,6 +246,7 @@ BITCOIN_CORE_H = \ util/fees.h \ util/getuniquepath.h \ util/golombrice.h \ + util/hash_type.h \ util/hasher.h \ util/macros.h \ util/message.h \ diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 45d93ca014f56..fc5a9d84cce5c 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -451,11 +451,11 @@ class CRegTestParams : public CChainParams { m_assumeutxo_data = MapAssumeutxo{ { 110, - {uint256S("0x1ebbf5850204c0bdb15bf030f47c7fe91d45c44c712697e4509ba67adb01c618"), 110}, + {AssumeutxoHash{uint256S("0x1ebbf5850204c0bdb15bf030f47c7fe91d45c44c712697e4509ba67adb01c618")}, 110}, }, { 210, - {uint256S("0x9c5ed99ef98544b34f8920b6d1802f72ac28ae6e2bd2bd4c316ff10c230df3f2"), 210}, + {AssumeutxoHash{uint256S("0x9c5ed99ef98544b34f8920b6d1802f72ac28ae6e2bd2bd4c316ff10c230df3f2")}, 210}, }, }; @@ -559,9 +559,3 @@ void SelectParams(const std::string& network) SelectBaseParams(network); globalChainParams = CreateChainParams(gArgs, network); } - -std::ostream& operator<<(std::ostream& o, const AssumeutxoData& aud) -{ - o << strprintf("AssumeutxoData(%s, %s)", aud.hash_serialized.ToString(), aud.nChainTx); - return o; -} diff --git a/src/chainparams.h b/src/chainparams.h index 6f231999868ab..5c2351eea69af 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -25,6 +26,10 @@ struct CCheckpointData { } }; +struct AssumeutxoHash : public BaseHash { + explicit AssumeutxoHash(const uint256& hash) : BaseHash(hash) {} +}; + /** * Holds configuration for use during UTXO snapshot load and validation. The contents * here are security critical, since they dictate which UTXO snapshots are recognized @@ -32,7 +37,7 @@ struct CCheckpointData { */ struct AssumeutxoData { //! The expected hash of the deserialized UTXO set. - const uint256 hash_serialized; + const AssumeutxoHash hash_serialized; //! Used to populate the nChainTx value, which is used during BlockManager::LoadBlockIndex(). //! @@ -41,8 +46,6 @@ struct AssumeutxoData { const unsigned int nChainTx; }; -std::ostream& operator<<(std::ostream& o, const AssumeutxoData& aud); - using MapAssumeutxo = std::map; /** diff --git a/src/coins.h b/src/coins.h index 5a6f73652b4e7..816b4864a386d 100644 --- a/src/coins.h +++ b/src/coins.h @@ -20,8 +20,6 @@ #include #include -class ChainstateManager; - /** * A UTXO entry. * diff --git a/src/script/standard.h b/src/script/standard.h index f2bf4a8af3501..12ab9979a8509 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -8,6 +8,7 @@ #include