Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 442 Lines • ▼ Show 20 Lines | |||||
* calculation and uses the LockPoints passed in for evaluation. The LockPoints | * calculation and uses the LockPoints passed in for evaluation. The LockPoints | ||||
* should not be considered valid if CheckSequenceLocks returns false. | * should not be considered valid if CheckSequenceLocks returns false. | ||||
* | * | ||||
* See consensus/consensus.h for flag definitions. | * See consensus/consensus.h for flag definitions. | ||||
*/ | */ | ||||
bool CheckSequenceLocks(const CTxMemPool &pool, const CTransaction &tx, | bool CheckSequenceLocks(const CTxMemPool &pool, const CTransaction &tx, | ||||
int flags, LockPoints *lp = nullptr, | int flags, LockPoints *lp = nullptr, | ||||
bool useExistingLockPoints = false) | bool useExistingLockPoints = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(::cs_main, pool.cs); | ||||
/** | /** | ||||
* Closure representing one script verification. | * Closure representing one script verification. | ||||
* Note that this stores references to the spending transaction. | * Note that this stores references to the spending transaction. | ||||
* | * | ||||
* Note that if pLimitSigChecks is passed, then failure does not imply that | * Note that if pLimitSigChecks is passed, then failure does not imply that | ||||
* scripts have failed. | * scripts have failed. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
* This is a variant of ContextualCheckTransaction which computes the contextual | * This is a variant of ContextualCheckTransaction which computes the contextual | ||||
* check for a transaction based on the chain tip. | * check for a transaction based on the chain tip. | ||||
* | * | ||||
* See consensus/consensus.h for flag definitions. | * See consensus/consensus.h for flag definitions. | ||||
*/ | */ | ||||
bool ContextualCheckTransactionForCurrentBlock(const Consensus::Params ¶ms, | bool ContextualCheckTransactionForCurrentBlock(const Consensus::Params ¶ms, | ||||
const CTransaction &tx, | const CTransaction &tx, | ||||
TxValidationState &state, | TxValidationState &state, | ||||
int flags = -1); | int flags = -1) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | |||||
/** | /** | ||||
* Check a block is completely valid from start to finish (only works on top of | * Check a block is completely valid from start to finish (only works on top of | ||||
* our current best block) | * our current best block) | ||||
*/ | */ | ||||
bool TestBlockValidity(BlockValidationState &state, const CChainParams ¶ms, | bool TestBlockValidity(BlockValidationState &state, const CChainParams ¶ms, | ||||
const CBlock &block, CBlockIndex *pindexPrev, | const CBlock &block, CBlockIndex *pindexPrev, | ||||
BlockValidationOptions validationOptions) | BlockValidationOptions validationOptions) | ||||
▲ Show 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | bool DisconnectTip(const CChainParams ¶ms, BlockValidationState &state, | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_mempool.cs); | EXCLUSIVE_LOCKS_REQUIRED(cs_main, m_mempool.cs); | ||||
// Manual block validity manipulation: | // Manual block validity manipulation: | ||||
bool PreciousBlock(const Config &config, BlockValidationState &state, | bool PreciousBlock(const Config &config, BlockValidationState &state, | ||||
CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main); | CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main); | ||||
/** Mark a block as invalid. */ | /** Mark a block as invalid. */ | ||||
bool InvalidateBlock(const Config &config, BlockValidationState &state, | bool InvalidateBlock(const Config &config, BlockValidationState &state, | ||||
CBlockIndex *pindex) | CBlockIndex *pindex) | ||||
LOCKS_EXCLUDED(cs_main, m_cs_chainstate); | EXCLUSIVE_LOCKS_REQUIRED(!cs_main, !m_cs_chainstate); | ||||
/** Park a block. */ | /** Park a block. */ | ||||
bool ParkBlock(const Config &config, BlockValidationState &state, | bool ParkBlock(const Config &config, BlockValidationState &state, | ||||
CBlockIndex *pindex) | CBlockIndex *pindex) | ||||
LOCKS_EXCLUDED(cs_main, m_cs_chainstate); | EXCLUSIVE_LOCKS_REQUIRED(!cs_main, !m_cs_chainstate); | ||||
/** | /** | ||||
* Finalize a block. | * Finalize a block. | ||||
* A finalized block can not be reorged in any way. | * A finalized block can not be reorged in any way. | ||||
*/ | */ | ||||
bool FinalizeBlock(const Config &config, BlockValidationState &state, | bool FinalizeBlock(const Config &config, BlockValidationState &state, | ||||
CBlockIndex *pindex) | CBlockIndex *pindex) | ||||
LOCKS_EXCLUDED(cs_main, m_cs_chainstate); | EXCLUSIVE_LOCKS_REQUIRED(!cs_main, !m_cs_chainstate); | ||||
/** Return the currently finalized block index. */ | /** Return the currently finalized block index. */ | ||||
const CBlockIndex *GetFinalizedBlock() const | const CBlockIndex *GetFinalizedBlock() const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
/** | /** | ||||
* Checks if a block is finalized. | * Checks if a block is finalized. | ||||
*/ | */ | ||||
bool IsBlockFinalized(const CBlockIndex *pindex) const | bool IsBlockFinalized(const CBlockIndex *pindex) const | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |