diff --git a/src/Makefile.am b/src/Makefile.am index 31d056c43e..27245506a6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -259,6 +259,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 77420ecb00..6b1d8d3fe4 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -551,11 +551,11 @@ public: m_assumeutxo_data = MapAssumeutxo{ { 110, - {uint256S("0x09a3e443dbf48f3b95207c9ce529062d9764395232c482aa7d3a0bf274d282d9"), 110}, + {AssumeutxoHash{uint256S("0x09a3e443dbf48f3b95207c9ce529062d9764395232c482aa7d3a0bf274d282d9")}, 110}, }, { 210, - {uint256S("0x9c5ed99ef98544b34f8920b6d1802f72ac28ae6e2bd2bd4c316ff10c230df3f2"), 210}, + {AssumeutxoHash{uint256S("0x9c5ed99ef98544b34f8920b6d1802f72ac28ae6e2bd2bd4c316ff10c230df3f2")}, 210}, }, }; @@ -1344,9 +1344,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 7ba62f3e35..69a4aec3df 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 8bb15e5163..3606d2f1b3 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 4205d5f1f3..4bc533249c 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -8,6 +8,7 @@ #include