Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 826 Lines • ▼ Show 20 Lines | bool DisconnectTip(const CChainParams ¶ms, BlockValidationState &state, | ||||
DisconnectedBlockTransactions *disconnectpool) | DisconnectedBlockTransactions *disconnectpool) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
// 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(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(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) LOCKS_EXCLUDED(cs_main); | CBlockIndex *pindex) | ||||
LOCKS_EXCLUDED(cs_main, m_cs_chainstate); | |||||
void ResetBlockFailureFlags(CBlockIndex *pindex) | void ResetBlockFailureFlags(CBlockIndex *pindex) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
template <typename F> | template <typename F> | ||||
bool UpdateFlagsForBlock(CBlockIndex *pindexBase, CBlockIndex *pindex, F f) | bool UpdateFlagsForBlock(CBlockIndex *pindexBase, CBlockIndex *pindex, F f) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
template <typename F, typename C, typename AC> | template <typename F, typename C, typename AC> | ||||
void UpdateFlags(CBlockIndex *pindex, CBlockIndex *&pindexReset, F f, | void UpdateFlags(CBlockIndex *pindex, CBlockIndex *&pindexReset, F f, | ||||
C fChild, AC fAncestorWasChanged) | C fChild, AC fAncestorWasChanged) | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | private: | ||||
void ReceivedBlockTransactions(const CBlock &block, CBlockIndex *pindexNew, | void ReceivedBlockTransactions(const CBlock &block, CBlockIndex *pindexNew, | ||||
const FlatFilePos &pos) | const FlatFilePos &pos) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
bool RollforwardBlock(const CBlockIndex *pindex, CCoinsViewCache &inputs, | bool RollforwardBlock(const CBlockIndex *pindex, CCoinsViewCache &inputs, | ||||
const Consensus::Params ¶ms) | const Consensus::Params ¶ms) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
bool UnwindBlock(const Config &config, BlockValidationState &state, | bool UnwindBlock(const Config &config, BlockValidationState &state, | ||||
CBlockIndex *pindex, bool invalidate); | CBlockIndex *pindex, bool invalidate) | ||||
EXCLUSIVE_LOCKS_REQUIRED(m_cs_chainstate); | |||||
}; | }; | ||||
/** | /** | ||||
* Mark a block as precious and reorganize. | * Mark a block as precious and reorganize. | ||||
* | * | ||||
* May not be called in a validationinterface callback. | * May not be called in a validationinterface callback. | ||||
*/ | */ | ||||
bool PreciousBlock(const Config &config, BlockValidationState &state, | bool PreciousBlock(const Config &config, BlockValidationState &state, | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |