aboutsummaryrefslogtreecommitdiff
path: root/src/validation.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-04-03 17:26:39 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-05-11 11:21:05 +0200
commitfa340b87944764ea4e8e04038fe7471fd452bc23 (patch)
tree1affc018b491df13daa027814cfea21bee8462df /src/validation.h
parentfae33f98e6a8d5934edbdce2eb8688112eac41a8 (diff)
downloadbitcoin-fa340b87944764ea4e8e04038fe7471fd452bc23.tar.xz
refactor: Avoid magic value of all-zeros in assumeutxo base_blockhash
Just use std::optional
Diffstat (limited to 'src/validation.h')
-rw-r--r--src/validation.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/validation.h b/src/validation.h
index 8fa45c3f77..1b50644185 100644
--- a/src/validation.h
+++ b/src/validation.h
@@ -553,7 +553,7 @@ public:
//! CChainState instances.
BlockManager& m_blockman;
- explicit CChainState(CTxMemPool& mempool, BlockManager& blockman, uint256 from_snapshot_blockhash = uint256());
+ explicit CChainState(CTxMemPool& mempool, BlockManager& blockman, std::optional<uint256> from_snapshot_blockhash = std::nullopt);
/**
* Initialize the CoinsViews UTXO set database management data structures. The in-memory
@@ -584,9 +584,9 @@ public:
/**
* The blockhash which is the base of the snapshot this chainstate was created from.
*
- * IsNull() if this chainstate was not created from a snapshot.
+ * std::nullopt if this chainstate was not created from a snapshot.
*/
- const uint256 m_from_snapshot_blockhash{};
+ const std::optional<uint256> m_from_snapshot_blockhash;
/**
* The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS (for itself and all ancestors) and
@@ -866,7 +866,7 @@ public:
// constructor
//! @param[in] snapshot_blockhash If given, signify that this chainstate
//! is based on a snapshot.
- CChainState& InitializeChainstate(CTxMemPool& mempool, const uint256& snapshot_blockhash = uint256())
+ CChainState& InitializeChainstate(CTxMemPool& mempool, const std::optional<uint256>& snapshot_blockhash = std::nullopt)
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
//! Get all chainstates currently being used.