Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show All 17 Lines | |||||
#include <consensus/consensus.h> | #include <consensus/consensus.h> | ||||
#include <disconnectresult.h> | #include <disconnectresult.h> | ||||
#include <flatfile.h> | #include <flatfile.h> | ||||
#include <fs.h> | #include <fs.h> | ||||
#include <protocol.h> // For CMessageHeader::MessageMagic | #include <protocol.h> // For CMessageHeader::MessageMagic | ||||
#include <script/script_error.h> | #include <script/script_error.h> | ||||
#include <script/script_metrics.h> | #include <script/script_metrics.h> | ||||
#include <sync.h> | #include <sync.h> | ||||
#include <txmempool.h> // For CTxMemPool::cs | |||||
#include <versionbits.h> | #include <versionbits.h> | ||||
#include <algorithm> | #include <algorithm> | ||||
#include <atomic> | #include <atomic> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <exception> | #include <exception> | ||||
#include <map> | #include <map> | ||||
#include <memory> | #include <memory> | ||||
▲ Show 20 Lines • Show All 784 Lines • ▼ Show 20 Lines | bool ConnectBlock(const CBlock &block, CValidationState &state, | ||||
CBlockIndex *pindex, CCoinsViewCache &view, | CBlockIndex *pindex, CCoinsViewCache &view, | ||||
const CChainParams ¶ms, | const CChainParams ¶ms, | ||||
BlockValidationOptions options, bool fJustCheck = false) | BlockValidationOptions options, bool fJustCheck = false) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
// Block disconnection on our pcoinsTip: | // Block disconnection on our pcoinsTip: | ||||
bool DisconnectTip(const CChainParams ¶ms, CValidationState &state, | bool DisconnectTip(const CChainParams ¶ms, CValidationState &state, | ||||
DisconnectedBlockTransactions *disconnectpool) | DisconnectedBlockTransactions *disconnectpool) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main, ::g_mempool.cs); | ||||
// Manual block validity manipulation: | // Manual block validity manipulation: | ||||
bool PreciousBlock(const Config &config, CValidationState &state, | bool PreciousBlock(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main); | CBlockIndex *pindex) LOCKS_EXCLUDED(cs_main); | ||||
bool UnwindBlock(const Config &config, CValidationState &state, | bool UnwindBlock(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindex, bool invalidate); | CBlockIndex *pindex, bool invalidate); | ||||
void ResetBlockFailureFlags(CBlockIndex *pindex) | void ResetBlockFailureFlags(CBlockIndex *pindex) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
Show All 21 Lines | public: | ||||
*/ | */ | ||||
bool IsInitialBlockDownload() const; | bool IsInitialBlockDownload() const; | ||||
private: | private: | ||||
bool ActivateBestChainStep(const Config &config, CValidationState &state, | bool ActivateBestChainStep(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindexMostWork, | CBlockIndex *pindexMostWork, | ||||
const std::shared_ptr<const CBlock> &pblock, | const std::shared_ptr<const CBlock> &pblock, | ||||
bool &fInvalidFound, ConnectTrace &connectTrace) | bool &fInvalidFound, ConnectTrace &connectTrace) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main, ::g_mempool.cs); | ||||
bool ConnectTip(const Config &config, CValidationState &state, | bool ConnectTip(const Config &config, CValidationState &state, | ||||
CBlockIndex *pindexNew, | CBlockIndex *pindexNew, | ||||
const std::shared_ptr<const CBlock> &pblock, | const std::shared_ptr<const CBlock> &pblock, | ||||
ConnectTrace &connectTrace, | ConnectTrace &connectTrace, | ||||
DisconnectedBlockTransactions &disconnectpool) | DisconnectedBlockTransactions &disconnectpool) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main, ::g_mempool.cs); | ||||
CBlockIndex *AddToBlockIndex(const CBlockHeader &block) | CBlockIndex *AddToBlockIndex(const CBlockHeader &block) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
/** Create a new block index entry for a given block hash */ | /** Create a new block index entry for a given block hash */ | ||||
CBlockIndex *InsertBlockIndex(const BlockHash &hash) | CBlockIndex *InsertBlockIndex(const BlockHash &hash) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
/** | /** | ||||
* Make various assertions about the state of the block index. | * Make various assertions about the state of the block index. | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |