Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show All 37 Lines | |||||
#include <vector> | #include <vector> | ||||
class BlockValidationState; | class BlockValidationState; | ||||
class CBlockIndex; | class CBlockIndex; | ||||
class CBlockTreeDB; | class CBlockTreeDB; | ||||
class CBlockUndo; | class CBlockUndo; | ||||
class CChainParams; | class CChainParams; | ||||
class CChain; | class CChain; | ||||
class CChainState; | |||||
class CConnman; | class CConnman; | ||||
class CInv; | class CInv; | ||||
class ChainstateManager; | class ChainstateManager; | ||||
class Config; | class Config; | ||||
class CScriptCheck; | class CScriptCheck; | ||||
class CTxMemPool; | class CTxMemPool; | ||||
class CTxUndo; | class CTxUndo; | ||||
class DisconnectedBlockTransactions; | class DisconnectedBlockTransactions; | ||||
▲ Show 20 Lines • Show All 515 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Maintains a tree of blocks (stored in `m_block_index`) which is consulted | * Maintains a tree of blocks (stored in `m_block_index`) which is consulted | ||||
* to determine where the most-work tip is. | * to determine where the most-work tip is. | ||||
* | * | ||||
* This data is used mostly in `CChainState` - information about, e.g., | * This data is used mostly in `CChainState` - information about, e.g., | ||||
* candidate tips is not maintained here. | * candidate tips is not maintained here. | ||||
*/ | */ | ||||
class BlockManager { | class BlockManager { | ||||
friend CChainState; | |||||
private: | |||||
// See definition for documentation | |||||
void FindFilesToPruneManual(std::set<int> &setFilesToPrune, | |||||
int nManualPruneHeight, int chain_tip_height); | |||||
void FindFilesToPrune(std::set<int> &setFilesToPrune, | |||||
uint64_t nPruneAfterHeight, int chain_tip_height, | |||||
bool is_ibd); | |||||
public: | public: | ||||
BlockMap m_block_index GUARDED_BY(cs_main); | BlockMap m_block_index GUARDED_BY(cs_main); | ||||
/** | /** | ||||
* In order to efficiently track invalidity of headers, we keep the set of | * In order to efficiently track invalidity of headers, we keep the set of | ||||
* blocks which we tried to connect and found to be invalid here (ie which | * blocks which we tried to connect and found to be invalid here (ie which | ||||
* were set to BLOCK_FAILED_VALID since the last restart). We can then | * were set to BLOCK_FAILED_VALID since the last restart). We can then | ||||
* walk this set and check if a new header is a descendant of something in | * walk this set and check if a new header is a descendant of something in | ||||
▲ Show 20 Lines • Show All 697 Lines • Show Last 20 Lines |