5#ifndef BITCOIN_NODE_BLOCKSTORAGE_H
6#define BITCOIN_NODE_BLOCKSTORAGE_H
static const unsigned int UNDOFILE_CHUNK_SIZE
The pre-allocation chunk size for rev?????.dat files (since 0.8)
std::atomic_bool fReindex
uint64_t nPruneTarget
Number of MiB of block files that we're trying to stay below.
static const unsigned int BLOCKFILE_CHUNK_SIZE
The pre-allocation chunk size for blk?????.dat files (since 0.8)
bool UndoReadFromDisk(CBlockUndo &blockundo, const CBlockIndex *pindex)
bool fHavePruned
Pruning-related variables and constants.
void ThreadImport(ChainstateManager &chainman, std::vector< fs::path > vImportFiles, const ArgsManager &args)
std::atomic_bool fImporting
CBlockFileInfo * GetBlockFileInfo(size_t n)
Get block file info entry for one block file.
uint64_t CalculateCurrentUsage()
Calculate the amount of disk space the block & undo files currently use.
void CleanupBlockRevFiles()
bool ReadRawBlockFromDisk(std::vector< uint8_t > &block, const FlatFilePos &pos, const CMessageHeader::MessageStartChars &message_start)
bool IsBlockPruned(const CBlockIndex *pblockindex)
Check whether the block associated with this index entry is pruned or not.
bool ReadBlockFromDisk(CBlock &block, const FlatFilePos &pos, const Consensus::Params &consensusParams)
Functions for disk access for blocks.
fs::path GetBlockPosFilename(const FlatFilePos &pos)
Translation to a filesystem path.
FILE * OpenBlockFile(const FlatFilePos &pos, bool fReadOnly=false)
Open a block file (blk?????.dat)
static constexpr bool DEFAULT_STOPAFTERBLOCKIMPORT
bool WriteUndoDataForBlock(const CBlockUndo &blockundo, BlockValidationState &state, CBlockIndex *pindex, const CChainParams &chainparams)
bool fPruneMode
True if we're running in -prune mode.
static const unsigned int MAX_BLOCKFILE_SIZE
The maximum size of a blk?????.dat file (since 0.8)
FlatFilePos SaveBlockToDisk(const CBlock &block, int nHeight, CChain &active_chain, const CChainParams &chainparams, const FlatFilePos *dbp)
Store block on disk.
void UnlinkPrunedFiles(const std::set< int > &setFilesToPrune)
Actually unlink the specified files.
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
Undo information for a CBlock.
An in-memory indexed chain of blocks.
CChainParams defines various tweakable parameters of a given instance of the Bitcoin system.
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Path class wrapper to prepare application code for transition from boost::filesystem library to std::...
Transaction validation functions.
Parameters that influence chain consensus.