mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
refactor: Use type-safe assumeutxo hash
This avoids accidentally mixing it up with other hashes (like block hashes).
This commit is contained in:
@@ -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().
|
||||
//!
|
||||
|
||||
Reference in New Issue
Block a user