Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
TestBlockManager Struct Reference

#include <validation.h>

Inheritance diagram for TestBlockManager:
[legend]
Collaboration diagram for TestBlockManager:
[legend]

Public Member Functions

void CleanupForFuzzing ()
 Test-only method to clear internal state for fuzzing.
Public Member Functions inherited from node::BlockManager
 BlockManager (const util::SignalInterrupt &interrupt, Options opts)
BlockMap m_block_index GUARDED_BY (cs_main)
std::unique_ptr< BlockTreeDB > m_block_tree_db GUARDED_BY (::cs_main)
CBlockIndexInsertBlockIndex (const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Create a new block index entry for a given block hash.
void PruneOneBlockFile (int fileNumber) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Mark one block file as pruned (modify associated database entries).
CBlockIndexLookupBlockIndex (const uint256 &hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
const CBlockIndexLookupBlockIndex (const uint256 &hash) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
CBlockFileInfoGetBlockFileInfo (size_t n)
 Get block file info entry for one block file.
void UpdateBlockInfo (const CBlock &block, unsigned int nHeight, const FlatFilePos &pos)
 Update blockfile info while processing a block during reindex.
bool IsPruneMode () const
 Whether running in -prune mode.
uint64_t GetPruneTarget () const
 Attempt to stay below this number of bytes of block files.
bool LoadingBlocks () const
uint64_t CalculateCurrentUsage ()
 Calculate the amount of disk space the block & undo files currently use.
fs::path GetBlockPosFilename (const FlatFilePos &pos) const
 Translation to a filesystem path.
void UnlinkPrunedFiles (const std::set< int > &setFilesToPrune) const
 Actually unlink the specified files.
bool ReadBlock (CBlock &block, const FlatFilePos &pos, const std::optional< uint256 > &expected_hash) const
 Functions for disk access for blocks.
bool ReadBlock (CBlock &block, const CBlockIndex &index) const
ReadRawBlockResult ReadRawBlock (const FlatFilePos &pos, std::optional< std::pair< size_t, size_t > > block_part=std::nullopt) const
bool ReadBlockUndo (CBlockUndo &blockundo, const CBlockIndex &index) const
void CleanupBlockRevFiles () const

Additional Inherited Members

Public Types inherited from node::BlockManager
using Options = kernel::BlockManagerOpts
using ReadRawBlockResult = util::Expected<std::vector<std::byte>, ReadRawError>
Public Attributes inherited from node::BlockManager
const util::SignalInterruptm_interrupt
std::atomic< bool > m_importing {false}
std::atomic_bool m_blockfiles_indexed {true}
 Whether all blockfiles have been added to the block tree database.
std::optional< int > m_snapshot_height
 The height of the base block of an assumeutxo snapshot, if one is in use.
std::vector< CBlockIndex * > GetAllBlockIndices() EXCLUSIVE_LOCKS_REQUIRED(std::multimap< CBlockIndex *, CBlockIndex * > m_blocks_unlinked
 All pairs A->B, where A (or one of its ancestors) misses transactions, but B has transactions.
void WriteBlockIndexDB() EXCLUSIVE_LOCKS_REQUIRED(bool LoadBlockIndexDB(const std::optional< uint256 > &snapshot_blockhash) EXCLUSIVE_LOCKS_REQUIRED(void ScanAndUnlinkAlreadyPrunedFiles() EXCLUSIVE_LOCKS_REQUIRED(CBlockIndex AddToBlockIndex )(const CBlockHeader &block, CBlockIndex *&best_header) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Remove any pruned block & undo files that are still on disk.
bool WriteBlockUndo(const CBlockUndo &blockundo, BlockValidationState &state, CBlockIndex &block) EXCLUSIVE_LOCKS_REQUIRED(FlatFilePo WriteBlock )(const CBlock &block, int nHeight)
 Store block on disk and update block file statistics.
bool CheckBlockDataAvailability(const CBlockIndex &upper_block, const CBlockIndex &lower_block, BlockStatus block_status=BLOCK_HAVE_DATA) EXCLUSIVE_LOCKS_REQUIRED(const CBlockIndex &GetFirstBlock(const CBlockIndex &upper_block LIFETIMEBOUND, uint32_t status_mask, const CBlockIndex *lower_block LIFETIMEBOUND=nullptr) const EXCLUSIVE_LOCKS_REQUIRED(boo m_have_pruned ) = false
 Returns the earliest block with specified status_mask flags set after the latest block not having those flags.
bool IsBlockPruned(const CBlockIndex &block) const EXCLUSIVE_LOCKS_REQUIRED(void UpdatePruneLock(const std::string &name, const PruneLockInfo &lock_info) EXCLUSIVE_LOCKS_REQUIRED(AutoFil OpenBlockFile )(const FlatFilePos &pos, bool fReadOnly) const
 Check whether the block associated with this index entry is pruned or not.
Static Public Attributes inherited from node::BlockManager
static constexpr auto PRUNE_TARGET_MANUAL {std::numeric_limits<uint64_t>::max()}
Protected Attributes inherited from node::BlockManager
std::vector< CBlockFileInfom_blockfile_info
std::set< CBlockIndex * > m_dirty_blockindex
 Dirty block index entries.
std::set< int > m_dirty_fileinfo
 Dirty block file entries.

Detailed Description

Definition at line 15 of file validation.h.

Member Function Documentation

◆ CleanupForFuzzing()

void TestBlockManager::CleanupForFuzzing ( )

Test-only method to clear internal state for fuzzing.

Definition at line 15 of file validation.cpp.


The documentation for this struct was generated from the following files: