diff options
author | MarcoFalke <falke.marco@gmail.com> | 2021-04-04 14:20:13 +0200 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2021-05-11 10:40:40 +0200 |
commit | fa5668bfb34e2778936af30e9fb6bd3c6bcf41fd (patch) | |
tree | 8e1325421d4e9e1570a812e5a7cff8839592bbb0 /src/chainparams.h | |
parent | 00000077098a23e0ac9781f5f799c90fd2fd97de (diff) |
refactor: Use type-safe assumeutxo hash
This avoids accidentally mixing it up with other hashes (like block
hashes).
Diffstat (limited to 'src/chainparams.h')
-rw-r--r-- | src/chainparams.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/chainparams.h b/src/chainparams.h index ae0b0f3c21..5c2351eea6 100644 --- a/src/chainparams.h +++ b/src/chainparams.h @@ -10,6 +10,7 @@ #include <consensus/params.h> #include <primitives/block.h> #include <protocol.h> +#include <util/hash_type.h> #include <memory> #include <vector> @@ -25,6 +26,10 @@ struct CCheckpointData { } }; +struct AssumeutxoHash : public BaseHash<uint256> { + 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(). //! |