mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 17:54:19 +02:00
chainparams: add allowed assumeutxo values
Values for mainnet and testnet will be specified in a follow-up PR that can be scrutinized accordingly. This structure is required for use in snapshot activation logic.
This commit is contained in:
committed by
James O'Beirne
parent
e9c037ba64
commit
7a6c46b37e
@@ -30,6 +30,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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user