6 #ifndef BITCOIN_VALIDATION_H 7 #define BITCOIN_VALIDATION_H 9 #if defined(HAVE_CONFIG_H) 109 typedef std::unordered_map<uint256, CBlockIndex*, BlockHasher>
BlockMap;
219 std::map<const uint256, const MempoolAcceptResult>&& results)
247 const
Package& txns,
bool test_accept)
293 bool useExistingLockPoints = false);
318 std::swap(ptxTo, check.
ptxTo);
319 std::swap(m_tx_out, check.
m_tx_out);
320 std::swap(nIn, check.
nIn);
321 std::swap(nFlags, check.
nFlags);
324 std::swap(txdata, check.
txdata);
344 bool fCheckPOW =
true,
401 void FindFilesToPruneManual(std::set<int>& setFilesToPrune,
int nManualPruneHeight,
int chain_tip_height);
418 void FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPruneAfterHeight,
int chain_tip_height,
int prune_height,
bool is_ibd);
460 std::set<CBlockIndex*, CBlockIndexWorkComparator>& block_index_candidates)
532 CoinsViews(std::string ldb_name,
size_t cache_size_bytes,
bool in_memory,
bool should_wipe);
607 std::optional<uint256> from_snapshot_blockhash = std::nullopt);
616 size_t cache_size_bytes,
619 std::string leveldb_name =
"chainstate");
680 bool ResizeCoinsCaches(
size_t coinstip_size,
size_t coinsdb_size)
684 void LoadExternalBlockFile(FILE* fileIn,
FlatFilePos* dbp =
nullptr);
700 int nManualPruneHeight = 0);
783 size_t max_coins_cache_size_bytes,
941 const std::optional<uint256>& snapshot_blockhash = std::nullopt)
971 return m_blockman.m_block_index;
1051 extern std::unique_ptr<CBlockTreeDB>
pblocktree;
1053 using FopenFn = std::function<FILE*(const fs::path&, const char*)>;
1070 #endif // BITCOIN_VALIDATION_H std::shared_ptr< const CTransaction > CTransactionRef
MempoolAcceptResult(std::list< CTransactionRef > &&replaced_txns, CAmount fees)
Constructor for success case.
static const unsigned int DEFAULT_ANCESTOR_SIZE_LIMIT
Default for -limitancestorsize, maximum kilobytes of tx + all in-mempool ancestors.
size_t m_coinstip_cache_size_bytes
The cache size of the in-memory coins view.
static const int DEFAULT_SCRIPTCHECK_THREADS
-par default (number of script-checking threads, 0 = auto)
bool LoadBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
bool CheckSequenceLocks(CBlockIndex *tip, const CCoinsView &coins_view, const CTransaction &tx, int flags, LockPoints *lp=nullptr, bool useExistingLockPoints=false)
Check if transaction will be BIP68 final in the next block to be created on top of tip...
int GetSpendHeight(const CCoinsViewCache &inputs) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Return the spend height, which is one more than the inputs.GetBestBlock().
CBlockIndex * FindMostWorkChain() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Return the tip of the chain with the most work in it, that isn't known to be invalid (it's however fa...
static const unsigned int DEFAULT_DESCENDANT_LIMIT
Default for -limitdescendantcount, max number of in-mempool descendants.
bool LoadBlockIndex(const Consensus::Params &consensus_params, CBlockTreeDB &blocktree, std::set< CBlockIndex *, CBlockIndexWorkComparator > &block_index_candidates) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Load the blocktree off disk and into memory.
int64_t nMaxTipAge
If the tip is older than this (in seconds), the node is considered to be in initial block download...
bool IsBackgroundIBD(CChainState *chainstate) const
SynchronizationState
Current sync state passed to tip changed callbacks.
bool operator()(const CBlockIndex *pa, const CBlockIndex *pb) const
CChain m_chain
The current chain of blockheaders we consult and build on.
CChainState & ValidatedChainstate() const
Return the most-work chainstate that has been fully validated.
void PruneBlockIndexCandidates()
Delete all entries in setBlockIndexCandidates that are worse than the current tip.
std::unique_ptr< CChainState > m_ibd_chainstate GUARDED_BY(::cs_main)
The chainstate used under normal operation (i.e.
FILE * fopen(const fs::path &p, const char *mode)
enum ScriptError_t ScriptError
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
CTransactionRef GetTransaction(const CBlockIndex *const block_index, const CTxMemPool *const mempool, const uint256 &hash, const Consensus::Params &consensusParams, uint256 &hashBlock)
Return transaction from the block at block_index.
void swap(CScriptCheck &check)
Maintains a tree of blocks (stored in m_block_index) which is consulted to determine where the most-w...
The cache is at >= 90% capacity.
A convenience class for constructing the CCoinsView* hierarchy used to facilitate access to the UTXO ...
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
void FindFilesToPrune(std::set< int > &setFilesToPrune, uint64_t nPruneAfterHeight, int chain_tip_height, int prune_height, bool is_ibd)
Prune block and undo files (blk???.dat and undo???.dat) so that the disk space used is less than a us...
An in-memory indexed chain of blocks.
CBlockIndex * GetLastCheckpoint(const CCheckpointData &data) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Returns last CBlockIndex* that is a checkpoint.
const std::optional< std::list< CTransactionRef > > m_replaced_transactions
Mempool transactions replaced by the tx per BIP 125 rules.
static const int64_t DEFAULT_MAX_TIP_AGE
void CheckBlockIndex()
Make various assertions about the state of the block index.
std::function< FILE *(const fs::path &, const char *)> FopenFn
PackageMempoolAcceptResult(PackageValidationState state, std::map< const uint256, const MempoolAcceptResult > &&results)
std::vector< CTransactionRef > Package
A package is an ordered list of transactions.
CBlockIndex * pindexBestHeader
Best header we've seen so far (used for getheaders queries' starting points).
static const unsigned int MIN_BLOCKS_TO_KEEP
Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ::ChainActive().Tip() will not be pruned.
static const unsigned int DEFAULT_ANCESTOR_LIMIT
Default for -limitancestorcount, max number of in-mempool ancestors.
bool RollforwardBlock(const CBlockIndex *pindex, CCoinsViewCache &inputs) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Apply the effects of a block on the utxo cache, ignoring that it may already have been applied...
CChain & ValidatedChain() const
bool g_parallel_script_checks
Whether there are dedicated script-checking threads running.
ResultType
Used to indicate the results of mempool validation.
int Height() const
Return the maximal height in the chain.
void ForceFlushStateToDisk()
Unconditionally flush all changes to disk.
std::map< const uint256, const MempoolAcceptResult > m_tx_results
Map from wtxid to finished MempoolAcceptResults.
bool DumpMempool(const CTxMemPool &pool, FopenFn mockable_fopen_function=fsbridge::fopen, bool skip_file_commit=false)
Dump the mempool to disk.
The coins cache is in immediate need of a flush.
void ResetCoinsViews()
Destructs all objects related to accessing the UTXO set.
CChainState stores and provides an API to update our local knowledge of the current best chain...
PackageMempoolAcceptResult(const uint256 &wtxid, const MempoolAcceptResult &result)
Constructor to create a PackageMempoolAcceptResult from a single MempoolAcceptResult.
const TxValidationState m_state
bool PreciousBlock(BlockValidationState &state, CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main)
Mark a block as precious and reorganize.
bool TestBlockValidity(BlockValidationState &state, const CChainParams &chainparams, CChainState &chainstate, const CBlock &block, CBlockIndex *pindexPrev, bool fCheckPOW=true, bool fCheckMerkleRoot=true) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Check a block is completely valid from start to finish (only works on top of our current best block) ...
static MempoolAcceptResult Success(std::list< CTransactionRef > &&replaced_txns, CAmount fees)
const std::optional< CAmount > m_base_fees
Raw base fees in satoshis.
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
const ResultType m_result_type
CBlockIndex * LookupBlockIndex(const uint256 &hash) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
std::atomic< bool > m_cached_finished_ibd
Whether this chainstate is undergoing initial block download.
bool DisconnectTip(BlockValidationState &state, DisconnectedBlockTransactions *disconnectpool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
Disconnect m_chain's tip.
const std::vector< std::string > CHECKLEVEL_DOC
Documentation for argument 'checklevel'.
double GuessVerificationProgress(const ChainTxData &data, const CBlockIndex *pindex)
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip).
bool ActivateBestChain(BlockValidationState &state, std::shared_ptr< const CBlock > pblock=nullptr) LOCKS_EXCLUDED(cs_main)
Find the best known block, and make it the tip of the block chain.
MempoolAcceptResult AcceptToMemoryPool(CChainState &active_chainstate, CTxMemPool &pool, const CTransactionRef &tx, bool bypass_limits, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
(Try to) add a transaction to the memory pool.
Called by RandAddPeriodic()
bool AbortNode(BlockValidationState &state, const std::string &strMessage, const bilingual_str &userMessage=bilingual_str{})
CScriptCheck(const CTxOut &outIn, const CTransaction &txToIn, unsigned int nInIn, unsigned int nFlagsIn, bool cacheIn, PrecomputedTransactionData *txdataIn)
Transaction validation functions.
void UpdateTip(const CBlockIndex *pindexNew) EXCLUSIVE_LOCKS_REQUIRED(frien ChainstateManager)
Check warning conditions and do some notifications on new chain tip set.
void InvalidBlockFound(CBlockIndex *pindex, const BlockValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
void LoadMempool(const ArgsManager &args)
Load the persisted mempool from disk.
const std::optional< uint256 > m_from_snapshot_blockhash
The blockhash which is the base of the snapshot this chainstate was created from. ...
int64_t CAmount
Amount in satoshis (Can be negative)
bool AcceptBlockHeader(const CBlockHeader &block, BlockValidationState &state, const CChainParams &chainparams, CBlockIndex **ppindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
If a block header hasn't already been seen, call CheckBlockHeader on it, ensure that it doesn't desce...
void PruneAndFlush()
Prune blockfiles from the disk if necessary and then flush chainstate changes if we pruned...
RecursiveMutex m_cs_chainstate
the ChainState CriticalSection A lock that must be held when modifying this ChainState - held in Acti...
std::string ToString(const T &t)
Locale-independent version of std::to_string.
CoinsViews(std::string ldb_name, size_t cache_size_bytes, bool in_memory, bool should_wipe)
This constructor initializes CCoinsViewDB and CCoinsViewErrorCatcher instances, but it does not creat...
static const bool DEFAULT_PERSIST_MEMPOOL
Default for -persistmempool.
bool m_snapshot_validated
If true, the assumed-valid chainstate has been fully validated by the background validation chainstat...
bool ActivateBestChainStep(BlockValidationState &state, CBlockIndex *pindexMostWork, const std::shared_ptr< const CBlock > &pblock, bool &fInvalidFound, ConnectTrace &connectTrace) EXCLUSIVE_LOCKS_REQUIRED(cs_main
Dictates whether we need to flush the cache to disk or not.
bool NeedsRedownload() const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Whether the chain state needs to be redownloaded due to lack of witness data.
void UpdateUncommittedBlockStructures(CBlock &block, const CBlockIndex *pindexPrev, const Consensus::Params &consensusParams)
Update uncommitted block structures (currently: only the witness reserved value). ...
bool IsSnapshotActive() const
CCoinsViewDB & CoinsDB() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Access to the block database (blocks/index/)
Abstract view on the open txout dataset.
bool PopulateAndValidateSnapshot(CChainState &snapshot_chainstate, CAutoFile &coins_file, const SnapshotMetadata &metadata)
Internal helper for ActivateSnapshot().
Validation result for package mempool acceptance.
BlockMap m_block_index GUARDED_BY(cs_main)
CBlockIndex * InsertBlockIndex(const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Create a new block index entry for a given block hash.
PackageMempoolAcceptResult ProcessNewPackage(CChainState &active_chainstate, CTxMemPool &pool, const Package &txns, bool test_accept) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Atomically test acceptance of a package.
void InitScriptExecutionCache()
Initializes the script-execution cache.
void MaybeUpdateMempoolForReorg(DisconnectedBlockTransactions &disconnectpool, bool fAddToMempool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
Make mempool consistent after a reorg, by re-adding or recursively erasing disconnected block transac...
bool LoadBlockIndex() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Load the block tree and coins database from disk, initializing state if we're running with -reindex...
bool IsSnapshotValidated() const
Is there a snapshot in use and has it been fully validated?
RAII wrapper for VerifyDB: Verify consistency of the block and coin databases.
static const unsigned int DEFAULT_MIN_RELAY_TX_FEE
Default for -minrelaytxfee, minimum relay fee for transactions.
CChainState *m_active_chainstate GUARDED_BY(::cs_main)
Points to either the ibd or snapshot chainstate; indicates our most-work chain.
Holds various statistics on transactions within a chain.
const PackageValidationState m_state
static const unsigned int DEFAULT_DESCENDANT_SIZE_LIMIT
Default for -limitdescendantsize, maximum kilobytes of in-mempool descendants.
static const unsigned int DEFAULT_MEMPOOL_EXPIRY
Default for -mempoolexpiry, expiration time for mempool transactions in hours.
static constexpr bool DEFAULT_COINSTATSINDEX
static const int DEFAULT_STOPATHEIGHT
Default for -stopatheight.
CBlockIndex * AddToBlockIndex(const CBlockHeader &block) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
arith_uint256 nMinimumChainWork
Minimum work we will assume exists on some valid chain.
An output of a transaction.
bool InvalidateBlock(BlockValidationState &state, CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main)
Mark a block as invalid.
std::unique_ptr< CoinsViews > m_coins_views
Manages the UTXO set, which is a reflection of the contents of m_chain.
const CChainParams & m_params
void PruneBlockFilesManual(CChainState &active_chainstate, int nManualPruneHeight)
Prune block files up to a given height.
Parameters that influence chain consensus.
bool ProcessNewBlock(const CChainParams &chainparams, const std::shared_ptr< const CBlock > &block, bool force_processing, bool *new_block) LOCKS_EXCLUDED(cs_main)
Process an incoming block.
void ReceivedBlockTransactions(const CBlock &block, CBlockIndex *pindexNew, const FlatFilePos &pos) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Mark a block as having its data received and checked (up to BLOCK_VALID_TRANSACTIONS).
CChainState(CTxMemPool *mempool, BlockManager &blockman, std::optional< uint256 > from_snapshot_blockhash=std::nullopt)
bool LoadMempool(CTxMemPool &pool, CChainState &active_chainstate, FopenFn mockable_fopen_function=fsbridge::fopen)
Load the mempool from disk.
static const char *const DEFAULT_BLOCKFILTERINDEX
arith_uint256 nLastPreciousChainwork
chainwork for the last block that preciousblock has been applied to.
Validation result for a single transaction mempool acceptance.
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params &consensusParams)
MempoolAcceptResult(TxValidationState state)
Constructor for failure case.
#define Assume(val)
Assume is the identity function.
256-bit unsigned big integer.
void StopScriptCheckWorkerThreads()
Stop all of the script checking worker threads.
bool ReplayBlocks()
Replay blocks that aren't fully applied to the database.
int64_t m_total_coinstip_cache
The total number of bytes available for us to use across all in-memory coins caches.
Closure representing one script verification Note that this stores references to the spending transac...
std::set< CBlockIndex * > m_failed_blocks
In order to efficiently track invalidity of headers, we keep the set of blocks which we tried to conn...
bool AcceptBlock(const std::shared_ptr< const CBlock > &pblock, BlockValidationState &state, CBlockIndex **ppindex, bool fRequested, const FlatFilePos *dbp, bool *fNewBlock) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Store block on disk.
bool ProcessNewBlockHeaders(const std::vector< CBlockHeader > &block, BlockValidationState &state, const CChainParams &chainparams, const CBlockIndex **ppindex=nullptr) LOCKS_EXCLUDED(cs_main)
Process incoming block headers.
int32_t nBlockSequenceId
Blocks loaded from disk are assigned id 0, so start the counter at 1.
CFeeRate minRelayTxFee
A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) ...
std::condition_variable g_best_block_cv
void CheckForkWarningConditions() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
const CTransaction * ptxTo
CChainState &InitializeChainstate(CTxMemPool *mempool, const std::optional< uint256 > &snapshot_blockhash=std::nullopt) EXCLUSIVE_LOCKS_REQUIRED(std::vector< CChainState * GetAll)()
Instantiate a new chainstate and assign it based upon whether it is from a snapshot.
DisconnectResult DisconnectBlock(const CBlock &block, const CBlockIndex *pindex, CCoinsViewCache &view)
Undo the effects of this block (with given index) on the UTXO set represented by coins.
bool ConnectBlock(const CBlock &block, BlockValidationState &state, CBlockIndex *pindex, CCoinsViewCache &view, bool fJustCheck=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Apply the effects of this block (with given index) on the UTXO set represented by coins...
static const bool DEFAULT_CHECKPOINTS_ENABLED
#define EXCLUSIVE_LOCKS_REQUIRED(...)
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
int32_t nBlockReverseSequenceId
Decreasing counter (used by subsequent preciousblock calls).
size_t m_coinsdb_cache_size_bytes
The cache size of the on-disk coins view.
#define LOCKS_EXCLUDED(...)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
CCoinsViewDB m_dbview GUARDED_BY(cs_main)
The lowest level of the CoinsViews cache hierarchy sits in a leveldb database on disk.
The block chain is a tree shaped structure starting with the genesis block at the root...
const CChainParams & Params()
Return the currently selected parameters.
bool FlushStateToDisk(BlockValidationState &state, FlushStateMode mode, int nManualPruneHeight=0)
Update the on-disk chain state.
Undo information for a CBlock.
static const signed int DEFAULT_CHECKBLOCKS
CCoinsView backed by the coin database (chainstate/)
bool ActivateSnapshot(CAutoFile &coins_file, const SnapshotMetadata &metadata, bool in_memory)
Construct and activate a Chainstate on the basis of UTXO snapshot data.
void UpdateCoins(const CTransaction &tx, CCoinsViewCache &inputs, int nHeight)
Apply the effects of this transaction on the UTXO set represented by view.
uint256 hashAssumeValid
Block hash whose ancestors we will assume to have valid scripts without checking them.
void Unload() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Clear all data members.
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
bool IsInitialBlockDownload() const
Check whether we are doing an initial block download (synchronizing from disk or network) ...
std::set< CBlockIndex *, CBlockIndexWorkComparator > setBlockIndexCandidates
The set of all CBlockIndex entries with BLOCK_VALID_TRANSACTIONS (for itself and all ancestors) and a...
std::vector< unsigned char > GenerateCoinbaseCommitment(CBlock &block, const CBlockIndex *pindexPrev, const Consensus::Params &consensusParams)
Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks...
Fee rate in satoshis per kilobyte: CAmount / kB.
Holds configuration for use during UTXO snapshot load and validation.
BlockManager & m_blockman
Reference to a BlockManager instance which itself is shared across all CChainState instances...
bool TestLockPointValidity(CChain &active_chain, const LockPoints *lp) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Test whether the LockPoints height and time are still valid on the current chain. ...
const AssumeutxoData * ExpectedAssumeutxo(const int height, const CChainParams ¶ms)
Return the expected assumeutxo value for a given height, if one exists.
CBlockIndex * ValidatedTip() const
CCoinsViewCache & CoinsTip() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
std::multimap< CBlockIndex *, CBlockIndex * > m_blocks_unlinked
All pairs A->B, where A (or one of its ancestors) misses transactions, but B has transactions.
bool CheckBlock(const CBlock &block, BlockValidationState &state, const Consensus::Params &consensusParams, bool fCheckPOW=true, bool fCheckMerkleRoot=true)
Functions for validating blocks and updating the block tree.
CChainState & ActiveChainstate() const
The most-work chain.
static MempoolAcceptResult Failure(TxValidationState state)
The basic transaction that is broadcasted on the network and contained in blocks. ...
std::optional< uint256 > SnapshotBlockhash() const
void UnloadBlockIndex(CTxMemPool *mempool, ChainstateManager &chainman)
Unload database information.
std::unordered_map< uint256, CBlockIndex *, BlockHasher > BlockMap
int64_t m_total_coinsdb_cache
The total number of bytes available for us to use across all leveldb coins databases.
CCoinsView that adds a memory cache for transactions to another CCoinsView.
bool LoadGenesisBlock()
Ensures we have a genesis block in the block tree, possibly writing one to disk.
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES
CBlockIndex * FindForkInGlobalIndex(const CChain &chain, const CBlockLocator &locator) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Find the last common block between the parameter chain and a locator.
void PruneOneBlockFile(const int fileNumber) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Mark one block file as pruned (modify associated database entries)
void InitCoinsDB(size_t cache_size_bytes, bool in_memory, bool should_wipe, std::string leveldb_name="chainstate")
Initialize the CoinsViews UTXO set database management data structures.
void StartScriptCheckWorkerThreads(int threads_num)
Run instances of script checking worker threads.
bool ConnectTip(BlockValidationState &state, CBlockIndex *pindexNew, const std::shared_ptr< const CBlock > &pblock, ConnectTrace &connectTrace, DisconnectedBlockTransactions &disconnectpool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
Connect a new block to m_chain.
This is a minimally invasive approach to shutdown on LevelDB read errors from the chainstate...
ScriptError GetScriptError() const
bool error(const char *fmt, const Args &... args)
std::unique_ptr< CBlockTreeDB > pblocktree
Global variable that points to the active block tree (protected by cs_main)
bool LoadChainTip() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Update the chain tip based on database information, i.e.
void ResetBlockFailureFlags(CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Remove invalidity status from a block and its descendants.
static const bool DEFAULT_TXINDEX
RecursiveMutex cs_nBlockSequenceId
Every received block is assigned a unique and increasing identifier, so we know which one to give pri...
RecursiveMutex * MempoolMutex() const LOCK_RETURNED(m_mempool -> cs)
Indirection necessary to make lock annotations work with an optional mempool.
CChain & ActiveChain() const
CCoinsViewErrorCatcher & CoinsErrorCatcher() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
static const unsigned int DEFAULT_CHECKLEVEL
Non-refcounted RAII wrapper for FILE*.
RecursiveMutex cs
This mutex needs to be locked when accessing mapTx or other members that are guarded by it...
static const int MAX_SCRIPTCHECK_THREADS
Maximum number of dedicated script-checking threads allowed.
void InvalidChainFound(CBlockIndex *pindexNew) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
bool CheckFinalTx(const CBlockIndex *active_chain_tip, const CTransaction &tx, int flags=-1) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Transaction validation functions.
CBlockIndex * ActiveTip() const
CTxMemPool * m_mempool
Optional mempool that is kept in sync with the chain.
Used to track blocks whose transactions were applied to the UTXO state as a part of a single Activate...
void FindFilesToPruneManual(std::set< int > &setFilesToPrune, int nManualPruneHeight, int chain_tip_height)
PrecomputedTransactionData * txdata
BlockMap & BlockIndex() EXCLUSIVE_LOCKS_REQUIRED(