![]() |
Bitcoin Core 22.99.0
P2P Digital Currency
|
Go to the source code of this file.
Namespaces | |
namespace | Consensus |
Transaction validation functions. | |
Functions | |
bool | IsBlockPruned (const CBlockIndex *pblockindex) |
Check whether the block associated with this index entry is pruned or not. More... | |
void | CleanupBlockRevFiles () |
FILE * | OpenBlockFile (const FlatFilePos &pos, bool fReadOnly=false) |
Open a block file (blk?????.dat) More... | |
fs::path | GetBlockPosFilename (const FlatFilePos &pos) |
Translation to a filesystem path. More... | |
CBlockFileInfo * | GetBlockFileInfo (size_t n) |
Get block file info entry for one block file. More... | |
uint64_t | CalculateCurrentUsage () |
Calculate the amount of disk space the block & undo files currently use. More... | |
void | UnlinkPrunedFiles (const std::set< int > &setFilesToPrune) |
Actually unlink the specified files. More... | |
bool | ReadBlockFromDisk (CBlock &block, const FlatFilePos &pos, const Consensus::Params &consensusParams) |
Functions for disk access for blocks. More... | |
bool | ReadBlockFromDisk (CBlock &block, const CBlockIndex *pindex, const Consensus::Params &consensusParams) |
bool | ReadRawBlockFromDisk (std::vector< uint8_t > &block, const FlatFilePos &pos, const CMessageHeader::MessageStartChars &message_start) |
bool | ReadRawBlockFromDisk (std::vector< uint8_t > &block, const CBlockIndex *pindex, const CMessageHeader::MessageStartChars &message_start) |
bool | UndoReadFromDisk (CBlockUndo &blockundo, const CBlockIndex *pindex) |
bool | WriteUndoDataForBlock (const CBlockUndo &blockundo, BlockValidationState &state, CBlockIndex *pindex, const CChainParams &chainparams) |
FlatFilePos | SaveBlockToDisk (const CBlock &block, int nHeight, CChain &active_chain, const CChainParams &chainparams, const FlatFilePos *dbp) |
Store block on disk. More... | |
void | ThreadImport (ChainstateManager &chainman, std::vector< fs::path > vImportFiles, const ArgsManager &args) |
Variables | |
static constexpr bool | DEFAULT_STOPAFTERBLOCKIMPORT {false} |
static const unsigned int | BLOCKFILE_CHUNK_SIZE = 0x1000000 |
The pre-allocation chunk size for blk?????.dat files (since 0.8) More... | |
static const unsigned int | UNDOFILE_CHUNK_SIZE = 0x100000 |
The pre-allocation chunk size for rev?????.dat files (since 0.8) More... | |
static const unsigned int | MAX_BLOCKFILE_SIZE = 0x8000000 |
The maximum size of a blk?????.dat file (since 0.8) More... | |
std::atomic_bool | fImporting |
std::atomic_bool | fReindex |
bool | fHavePruned |
Pruning-related variables and constants. More... | |
bool | fPruneMode |
True if we're running in -prune mode. More... | |
uint64_t | nPruneTarget |
Number of MiB of block files that we're trying to stay below. More... | |
uint64_t CalculateCurrentUsage | ( | ) |
Calculate the amount of disk space the block & undo files currently use.
Definition at line 191 of file blockstorage.cpp.
void CleanupBlockRevFiles | ( | ) |
Definition at line 61 of file blockstorage.cpp.
CBlockFileInfo * GetBlockFileInfo | ( | size_t | n | ) |
Get block file info entry for one block file.
Definition at line 103 of file blockstorage.cpp.
fs::path GetBlockPosFilename | ( | const FlatFilePos & | pos | ) |
Translation to a filesystem path.
Definition at line 233 of file blockstorage.cpp.
bool IsBlockPruned | ( | const CBlockIndex * | pblockindex | ) |
Check whether the block associated with this index entry is pruned or not.
Definition at line 50 of file blockstorage.cpp.
FILE * OpenBlockFile | ( | const FlatFilePos & | pos, |
bool | fReadOnly = false |
||
) |
Open a block file (blk?????.dat)
Definition at line 222 of file blockstorage.cpp.
bool ReadBlockFromDisk | ( | CBlock & | block, |
const CBlockIndex * | pindex, | ||
const Consensus::Params & | consensusParams | ||
) |
bool ReadBlockFromDisk | ( | CBlock & | block, |
const FlatFilePos & | pos, | ||
const Consensus::Params & | consensusParams | ||
) |
Functions for disk access for blocks.
Definition at line 367 of file blockstorage.cpp.
bool ReadRawBlockFromDisk | ( | std::vector< uint8_t > & | block, |
const CBlockIndex * | pindex, | ||
const CMessageHeader::MessageStartChars & | message_start | ||
) |
bool ReadRawBlockFromDisk | ( | std::vector< uint8_t > & | block, |
const FlatFilePos & | pos, | ||
const CMessageHeader::MessageStartChars & | message_start | ||
) |
Definition at line 411 of file blockstorage.cpp.
FlatFilePos SaveBlockToDisk | ( | const CBlock & | block, |
int | nHeight, | ||
CChain & | active_chain, | ||
const CChainParams & | chainparams, | ||
const FlatFilePos * | dbp | ||
) |
Store block on disk.
If dbp is non-nullptr, the file is known to already reside on disk
Definition at line 458 of file blockstorage.cpp.
void ThreadImport | ( | ChainstateManager & | chainman, |
std::vector< fs::path > | vImportFiles, | ||
const ArgsManager & | args | ||
) |
Definition at line 492 of file blockstorage.cpp.
bool UndoReadFromDisk | ( | CBlockUndo & | blockundo, |
const CBlockIndex * | pindex | ||
) |
Definition at line 139 of file blockstorage.cpp.
void UnlinkPrunedFiles | ( | const std::set< int > & | setFilesToPrune | ) |
Actually unlink the specified files.
Definition at line 202 of file blockstorage.cpp.
bool WriteUndoDataForBlock | ( | const CBlockUndo & | blockundo, |
BlockValidationState & | state, | ||
CBlockIndex * | pindex, | ||
const CChainParams & | chainparams | ||
) |
Definition at line 338 of file blockstorage.cpp.
|
static |
The pre-allocation chunk size for blk?????.dat files (since 0.8)
Definition at line 32 of file blockstorage.h.
|
staticconstexpr |
Definition at line 29 of file blockstorage.h.
|
extern |
Pruning-related variables and constants.
True if any block files have ever been pruned.
Definition at line 25 of file blockstorage.cpp.
|
extern |
|
extern |
True if we're running in -prune mode.
Definition at line 26 of file blockstorage.cpp.
|
extern |
|
static |
The maximum size of a blk?????.dat file (since 0.8)
Definition at line 36 of file blockstorage.h.
|
extern |
Number of MiB of block files that we're trying to stay below.
Definition at line 27 of file blockstorage.cpp.
|
static |
The pre-allocation chunk size for rev?????.dat files (since 0.8)
Definition at line 34 of file blockstorage.h.