6 #ifndef BITCOIN_VALIDATION_H 7 #define BITCOIN_VALIDATION_H 9 #if defined(HAVE_CONFIG_H) 56 class SnapshotMetadata;
218 std::map<const uint256, const MempoolAcceptResult>&& results)
222 std::map<const uint256, const MempoolAcceptResult>&& results)
244 int64_t accept_time,
bool bypass_limits,
bool test_accept)
256 const Package& txns,
bool test_accept)
287 bool useExistingLockPoints =
false);
313 std::swap(
ptxTo, check.ptxTo);
314 std::swap(
m_tx_out, check.m_tx_out);
315 std::swap(
nIn, check.nIn);
316 std::swap(
nFlags, check.nFlags);
318 std::swap(
error, check.error);
319 std::swap(
txdata, check.txdata);
340 bool fCheckPOW =
true,
408 CoinsViews(
fs::path ldb_name,
size_t cache_size_bytes,
bool in_memory,
bool should_wipe);
491 std::optional<uint256> from_snapshot_blockhash = std::nullopt);
500 size_t cache_size_bytes,
503 fs::path leveldb_name =
"chainstate");
580 bool ResizeCoinsCaches(
size_t coinstip_size,
size_t coinsdb_size)
609 void LoadExternalBlockFile(
612 std::multimap<uint256, FlatFilePos>* blocks_with_unknown_parent =
nullptr)
629 int nManualPruneHeight = 0);
653 bool ActivateBestChain(
655 std::shared_ptr<const
CBlock> pblock =
nullptr)
700 bool IsInitialBlockDownload() const;
724 size_t max_coins_cache_size_bytes,
868 std::chrono::time_point<std::chrono::steady_clock> m_last_presync_update
GUARDED_BY(::
cs_main) {};
941 const std::optional<uint256>& snapshot_blockhash = std::nullopt)
1045 void UpdateUncommittedBlockStructures(
CBlock& block, const
CBlockIndex* pindexPrev) const;
1060 template<typename DEP>
1063 return DeploymentActiveAfter(pindexPrev, chainman.GetConsensus(), dep, chainman.m_versionbitscache);
1066 template<
typename DEP>
1072 template<
typename DEP>
1087 #endif // BITCOIN_VALIDATION_H std::shared_ptr< const CTransaction > CTransactionRef
CCoinsViewCache & CoinsTip() EXCLUSIVE_LOCKS_REQUIRED(
static const int DEFAULT_SCRIPTCHECK_THREADS
-par default (number of script-checking threads, 0 = auto)
node::BlockManager m_blockman
A single BlockManager instance is shared across each constructed chainstate to avoid duplicating bloc...
const std::optional< uint256 > m_from_snapshot_blockhash
The blockhash which is the base of the snapshot this chainstate was created from. ...
bool m_snapshot_validated GUARDED_BY(::cs_main)
If true, the assumed-valid chainstate has been fully validated by the background validation chainstat...
void InvalidChainFound(CBlockIndex *pindexNew) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
CTxMemPool * m_mempool
Optional mempool that is kept in sync with the chain.
bool ReplayBlocks()
Replay blocks that aren't fully applied to the database.
bool PopulateAndValidateSnapshot(Chainstate &snapshot_chainstate, AutoFile &coins_file, const node::SnapshotMetadata &metadata)
Internal helper for ActivateSnapshot().
bool DeploymentActiveAfter(const CBlockIndex *pindexPrev, const ChainstateManager &chainman, DEP dep)
Deployment* info via ChainstateManager.
std::chrono::time_point< NodeClock > time_point
bool DeploymentActiveAt(const CBlockIndex &index, const ChainstateManager &chainman, DEP dep)
int64_t nMaxTipAge
If the tip is older than this (in seconds), the node is considered to be in initial block download...
RecursiveMutex * MempoolMutex() const LOCK_RETURNED(m_mempool -> cs)
Indirection necessary to make lock annotations work with an optional mempool.
bool TestBlockValidity(BlockValidationState &state, const CChainParams &chainparams, Chainstate &chainstate, const CBlock &block, CBlockIndex *pindexPrev, const std::function< NodeClock::time_point()> &adjusted_time_callback, 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) ...
SynchronizationState
Current sync state passed to tip changed callbacks.
std::set< CBlockIndex *, node::CBlockIndexWorkComparator > setBlockIndexCandidates
The set of all CBlockIndex entries with either BLOCK_VALID_TRANSACTIONS (for itself and all ancestors...
CBlockIndex * m_best_header
Best header we've seen so far (used for getheaders queries' starting points).
FILE * fopen(const fs::path &p, const char *mode)
bool LoadGenesisBlock()
Ensures we have a genesis block in the block tree, possibly writing one to disk.
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...
CBlockIndex *m_best_invalid GUARDED_BY(::cs_main)
GlobalMutex g_best_block_mutex
Valid, transaction was already in the mempool.
node::BlockManager & m_blockman
Reference to a BlockManager instance which itself is shared across all Chainstate instances...
bool InitScriptExecutionCache(size_t max_size_bytes)
Initializes the script-execution cache.
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...
An in-memory indexed chain of blocks.
MempoolAcceptResult(std::list< CTransactionRef > &&replaced_txns, int64_t vsize, CAmount fees)
Constructor for success case.
const std::optional< std::list< CTransactionRef > > m_replaced_transactions
Mempool transactions replaced by the tx.
void UpdateTip(const CBlockIndex *pindexNew) EXCLUSIVE_LOCKS_REQUIRED(frien ChainstateManager)
Check warning conditions and do some notifications on new chain tip set.
static const int64_t DEFAULT_MAX_TIP_AGE
size_t m_coinsdb_cache_size_bytes
The cache size of the on-disk coins view.
PackageMempoolAcceptResult(PackageValidationState state, std::map< const uint256, const MempoolAcceptResult > &&results)
std::vector< CTransactionRef > Package
A package is an ordered list of transactions.
static const unsigned int MIN_BLOCKS_TO_KEEP
Block files containing a block-height within MIN_BLOCKS_TO_KEEP of ActiveChain().Tip() will not be pr...
std::unique_ptr< CoinsViews > m_coins_views
Manages the UTXO set, which is a reflection of the contents of m_chain.
CChain & ActiveChain() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex())
bool g_parallel_script_checks
Whether there are dedicated script-checking threads running.
static constexpr int DEFAULT_CHECKLEVEL
ResultType
Used to indicate the results of mempool validation.
int Height() const
Return the maximal height in the chain.
std::unordered_map< uint256, CBlockIndex, BlockHasher > BlockMap
std::map< const uint256, const MempoolAcceptResult > m_tx_results
Map from wtxid to finished MempoolAcceptResults.
const CChainParams & chainparams
static MempoolAcceptResult Success(std::list< CTransactionRef > &&replaced_txns, int64_t vsize, CAmount fees)
std::chrono::time_point< std::chrono::steady_clock > m_last_presync_update GUARDED_BY(::cs_main)
Most recent headers presync progress update, for rate-limiting.
bool AcceptBlockHeader(const CBlockHeader &block, BlockValidationState &state, CBlockIndex **ppindex, bool min_pow_checked) 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 InitCoinsDB(size_t cache_size_bytes, bool in_memory, bool should_wipe, fs::path leveldb_name="chainstate")
Initialize the CoinsViews UTXO set database management data structures.
bool CheckFinalTxAtTip(const CBlockIndex &active_chain_tip, const CTransaction &tx)
Chainstate *m_active_chainstate GUARDED_BY(::cs_main)
Points to either the ibd or snapshot chainstate; indicates our most-work chain.
The coins cache is in immediate need of a flush.
An options struct for ChainstateManager, more ergonomically referred to as ChainstateManager::Options...
bool HasValidProofOfWork(const std::vector< CBlockHeader > &headers, const Consensus::Params &consensusParams)
Check with the proof of work on each blockheader matches the value in nBits.
arith_uint256 nLastPreciousChainwork
chainwork for the last block that preciousblock has been applied to.
PackageMempoolAcceptResult(const uint256 &wtxid, const MempoolAcceptResult &result)
Constructor to create a PackageMempoolAcceptResult from a single MempoolAcceptResult.
std::optional< CFeeRate > m_package_feerate
Package feerate, defined as the aggregated modified fees divided by the total virtual size of all tra...
const std::optional< int64_t > m_vsize
Virtual size as used by the mempool, calculated using serialized size and sigops. ...
const TxValidationState m_state
Contains information about why the transaction failed.
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...
const std::optional< CAmount > m_base_fees
Raw base fees in satoshis.
CoinsViews(fs::path 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...
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system...
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.
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...
const ResultType m_result_type
Result type.
void CheckBlockIndex()
Make various assertions about the state of the block index.
void InvalidBlockFound(CBlockIndex *pindex, const BlockValidationState &state) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
ChainstateManager(Options options)
bool DeploymentEnabled(const ChainstateManager &chainman, DEP dep)
const std::vector< std::string > CHECKLEVEL_DOC
Documentation for argument 'checklevel'.
CChain m_chain
The current chain of blockheaders we consult and build on.
double GuessVerificationProgress(const ChainTxData &data, const CBlockIndex *pindex)
Guess verification progress (as a fraction between 0.0=genesis and 1.0=current tip).
bool CheckFinalTxAtTip(const CBlockIndex &active_chain_tip, const CTransaction &tx) EXCLUSIVE_LOCKS_REQUIRED(bool CheckSequenceLocksAtTip(CBlockIndex *tip, const CCoinsView &coins_view, const CTransaction &tx, LockPoints *lp=nullptr, bool useExistingLockPoints=false)
Check if transaction will be final in the next block to be created.
Non-refcounted RAII wrapper for FILE*.
Bridge operations to C stdio.
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).
Filesystem operations and types.
void ResetCoinsViews()
Destructs all objects related to accessing the UTXO set.
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)
bool FlushStateToDisk(BlockValidationState &state, FlushStateMode mode, int nManualPruneHeight=0)
Update the on-disk chain state.
Transaction validation functions.
VersionBitsCache m_versionbitscache
Track versionbit status.
bool ProcessNewBlock(const std::shared_ptr< const CBlock > &block, bool force_processing, bool min_pow_checked, bool *new_block) LOCKS_EXCLUDED(cs_main)
Process an incoming block.
void PruneBlockFilesManual(Chainstate &active_chainstate, int nManualPruneHeight)
Prune block files up to a given height.
int64_t CAmount
Amount in satoshis (Can be negative)
void PruneAndFlush()
Prune blockfiles from the disk if necessary and then flush chainstate changes if we pruned...
bool ActivateBestChain(BlockValidationState &state, std::shared_ptr< const CBlock > pblock=nullptr) LOCKS_EXCLUDED(bool AcceptBlock(const std::shared_ptr< const CBlock > &pblock, BlockValidationState &state, CBlockIndex **ppindex, bool fRequested, const FlatFilePos *dbp, bool *fNewBlock, bool min_pow_checked) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Find the best known block, and make it the tip of the block chain.
std::function< FILE *(const fs::path &, const char *)> FopenFn
std::string ToString(const T &t)
Locale-independent version of std::to_string.
ChainstateManager & m_chainman
The chainstate manager that owns this chainstate.
bool DisconnectTip(BlockValidationState &state, DisconnectedBlockTransactions *disconnectpool) EXCLUSIVE_LOCKS_REQUIRED(cs_main
Disconnect m_chain's tip.
int32_t nBlockSequenceId GUARDED_BY(::cs_main)
Every received block is assigned a unique and increasing identifier, so we know which one to give pri...
bool IsSnapshotActive() const
Chainstate stores and provides an API to update our local knowledge of the current best chain...
const CChainParams & m_params
Chain parameters for this chainstate.
void swap(CScriptCheck &check) noexcept
Access to the block database (blocks/index/)
const CBlockIndex * FindForkInGlobalIndex(const CBlockLocator &locator) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Find the last common block of this chain and a locator.
Abstract view on the open txout dataset.
bool reliesOnAssumedValid()
Return true if this chainstate relies on blocks that are assumed-valid.
Validation result for package mempool acceptance.
DisconnectResult DisconnectBlock(const CBlock &block, const CBlockIndex *pindex, CCoinsViewCache &view) EXCLUSIVE_LOCKS_REQUIRED(boo 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...
std::vector< unsigned char > GenerateCoinbaseCommitment(CBlock &block, const CBlockIndex *pindexPrev) const
Produce the necessary coinbase commitment for a block (modifies the hash, don't call for mined blocks...
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...
const std::function< NodeClock::time_point()> adjusted_time_callback
int32_t nBlockReverseSequenceId
Decreasing counter (used by subsequent preciousblock calls).
bool LoadBlockIndex() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Load the block tree and coins database from disk, initializing state if we're running with -reindex...
Chainstate(CTxMemPool *mempool, node::BlockManager &blockman, ChainstateManager &chainman, std::optional< uint256 > from_snapshot_blockhash=std::nullopt)
RAII wrapper for VerifyDB: Verify consistency of the block and coin databases.
bool NeedsRedownload() const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Whether the chain state needs to be redownloaded due to lack of witness data.
Holds various statistics on transactions within a chain.
const PackageValidationState m_state
static constexpr bool DEFAULT_COINSTATSINDEX
static const int DEFAULT_STOPATHEIGHT
Default for -stopatheight.
PackageMempoolAcceptResult(PackageValidationState state, CFeeRate feerate, std::map< const uint256, const MempoolAcceptResult > &&results)
const Consensus::Params & GetConsensus() const
void LoadMempool(const fs::path &load_path, fsbridge::FopenFn mockable_fopen_function=fsbridge::fopen)
Load the persisted mempool from disk.
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.
CBlockIndex * ActiveTip() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex())
Maintains a tree of blocks (stored in m_block_index) which is consulted to determine where the most-w...
CCoinsViewDB & CoinsDB() EXCLUSIVE_LOCKS_REQUIRED(
arith_uint256 nMinimumChainWork
Minimum work we will assume exists on some valid chain.
void ForceFlushStateToDisk()
Unconditionally flush all changes to disk.
CCoinsViewErrorCatcher & CoinsErrorCatcher() EXCLUSIVE_LOCKS_REQUIRED(
An output of a transaction.
bool LoadChainTip() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Update the chain tip based on database information, i.e.
RecursiveMutex & GetMutex() const LOCK_RETURNED(
Alias for cs_main.
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...
Parameters that influence chain consensus.
static const char *const DEFAULT_BLOCKFILTERINDEX
MempoolAcceptResult AcceptToMemoryPool(Chainstate &active_chainstate, const CTransactionRef &tx, int64_t accept_time, bool bypass_limits, bool test_accept) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Try to add a transaction to the mempool.
Chainstate &InitializeChainstate(CTxMemPool *mempool, const std::optional< uint256 > &snapshot_blockhash=std::nullopt) LIFETIMEBOUND EXCLUSIVE_LOCKS_REQUIRED(std::vector< Chainstate * GetAll)()
Instantiate a new chainstate and assign it based upon whether it is from a snapshot.
Validation result for a single transaction mempool acceptance.
CAmount GetBlockSubsidy(int nHeight, const Consensus::Params &consensusParams)
MempoolAcceptResult(TxValidationState state)
Constructor for failure case.
static MempoolAcceptResult MempoolTx(int64_t vsize, CAmount fees)
#define Assume(val)
Assume is the identity function.
256-bit unsigned big integer.
void StopScriptCheckWorkerThreads()
Stop all of the script checking worker threads.
const std::optional< uint256 > m_other_wtxid
The wtxid of the transaction in the mempool which has the same txid but different witness...
int64_t m_total_coinstip_cache
The total number of bytes available for us to use across all in-memory coins caches.
BIP 9 allows multiple softforks to be deployed in parallel.
node::BlockMap & BlockIndex() EXCLUSIVE_LOCKS_REQUIRED(
uint256 g_best_block
Used to notify getblocktemplate RPC of new tips.
Closure representing one script verification Note that this stores references to the spending transac...
PackageMempoolAcceptResult ProcessNewPackage(Chainstate &active_chainstate, CTxMemPool &pool, const Package &txns, bool test_accept) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Validate (and maybe submit) a package to the mempool.
std::condition_variable g_best_block_cv
const CChainParams & GetParams() const
arith_uint256 CalculateHeadersWork(const std::vector< CBlockHeader > &headers)
Return the sum of the work on a given set of headers.
const CTransaction * ptxTo
std::atomic< bool > m_cached_finished_ibd
Whether this chainstate is undergoing initial block download.
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 ...
MempoolAcceptResult(const uint256 &other_wtxid)
Constructor for witness-swapped case.
#define LOCKS_EXCLUDED(...)
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate...
bool ActivateSnapshot(AutoFile &coins_file, const node::SnapshotMetadata &metadata, bool in_memory)
Construct and activate a Chainstate on the basis of UTXO snapshot data.
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.
static const signed int DEFAULT_CHECKBLOCKS
CCoinsView backed by the coin database (chainstate/)
void PruneBlockIndexCandidates()
Delete all entries in setBlockIndexCandidates that are worse than the current tip.
uint256 hashAssumeValid
Block hash whose ancestors we will assume to have valid scripts without checking them.
CBlockIndex * Tip() const
Returns the index entry for the tip of this chain, or nullptr if none.
int ActiveHeight() const EXCLUSIVE_LOCKS_REQUIRED(GetMutex())
Fee rate in satoshis per kilovirtualbyte: CAmount / kvB.
Holds configuration for use during UTXO snapshot load and validation.
const AssumeutxoData * ExpectedAssumeutxo(const int height, const CChainParams ¶ms)
Return the expected assumeutxo value for a given height, if one exists.
size_t m_coinstip_cache_size_bytes
The cache size of the in-memory coins view.
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.
Mutex m_chainstate_mutex
The ChainState Mutex A lock that must be held when modifying this ChainState - held in ActivateBestCh...
static MempoolAcceptResult Failure(TxValidationState state)
The basic transaction that is broadcasted on the network and contained in blocks. ...
Different type to mark Mutex at global scope.
void CheckForkWarningConditions() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
std::optional< uint256 > SnapshotBlockhash() const
const Consensus::Params & GetConsensus() const
Chainstate & ActiveChainstate() const
The most-work chain.
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.
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES
MempoolAcceptResult(int64_t vsize, CAmount fees)
Constructor for already-in-mempool case.
void StartScriptCheckWorkerThreads(int threads_num)
Run instances of script checking worker threads.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
This is a minimally invasive approach to shutdown on LevelDB read errors from the chainstate...
bool PreciousBlock(BlockValidationState &state, CBlockIndex *pindex) LOCKS_EXCLUDED(bool InvalidateBlock(BlockValidationState &state, CBlockIndex *pindex) LOCKS_EXCLUDED(voi ResetBlockFailureFlags)(CBlockIndex *pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Mark a block as precious and reorganize.
ScriptError GetScriptError() const
void ReportHeadersPresync(const arith_uint256 &work, int64_t height, int64_t timestamp)
This is used by net_processing to report pre-synchronization progress of headers, as headers are not ...
static const bool DEFAULT_TXINDEX
std::unique_ptr< Chainstate > m_ibd_chainstate GUARDED_BY(::cs_main)
The chainstate used under normal operation (i.e.
static MempoolAcceptResult MempoolTxDifferentWitness(const uint256 &other_wtxid)
CTxMemPool * GetMempool()
bool IsSnapshotValidated() const EXCLUSIVE_LOCKS_REQUIRED(
Is there a snapshot in use and has it been fully validated?
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.
#define Assert(val)
Identity function.
Used to track blocks whose transactions were applied to the UTXO state as a part of a single Activate...
bool ProcessNewBlockHeaders(const std::vector< CBlockHeader > &block, bool min_pow_checked, BlockValidationState &state, const CBlockIndex **ppindex=nullptr) LOCKS_EXCLUDED(cs_main)
Process incoming block headers.
MempoolAcceptResult ProcessTransaction(const CTransactionRef &tx, bool test_accept=false) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Try to add a transaction to the memory pool.
PrecomputedTransactionData * txdata