Bitcoin ABC  0.22.13
P2P Digital Currency
Functions | Variables
blockdb.cpp File Reference
#include <blockdb.h>
#include <blockindex.h>
#include <clientversion.h>
#include <pow/pow.h>
#include <primitives/block.h>
#include <streams.h>
#include <util/system.h>
Include dependency graph for blockdb.cpp:

Go to the source code of this file.

Functions

FlatFileSeq BlockFileSeq ()
 
FlatFileSeq UndoFileSeq ()
 
FILE * OpenBlockFile (const FlatFilePos &pos, bool fReadOnly)
 Open a block file (blk?????.dat). More...
 
FILE * OpenUndoFile (const FlatFilePos &pos, bool fReadOnly)
 Open an undo file (rev?????.dat) More...
 
fs::path GetBlockPosFilename (const FlatFilePos &pos)
 Translation to a filesystem path. More...
 
bool ReadBlockFromDisk (CBlock &block, const FlatFilePos &pos, const Consensus::Params &params)
 Functions for disk access for blocks. More...
 
bool ReadBlockFromDisk (CBlock &block, const CBlockIndex *pindex, const Consensus::Params &params)
 

Variables

RecursiveMutex cs_main
 Global state. More...
 

Function Documentation

◆ BlockFileSeq()

FlatFileSeq BlockFileSeq ( )

Definition at line 12 of file blockdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBlockPosFilename()

fs::path GetBlockPosFilename ( const FlatFilePos pos)

Translation to a filesystem path.

Definition at line 29 of file blockdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenBlockFile()

FILE* OpenBlockFile ( const FlatFilePos pos,
bool  fReadOnly 
)

Open a block file (blk?????.dat).

Definition at line 20 of file blockdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenUndoFile()

FILE* OpenUndoFile ( const FlatFilePos pos,
bool  fReadOnly 
)

Open an undo file (rev?????.dat)

Definition at line 25 of file blockdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadBlockFromDisk() [1/2]

bool ReadBlockFromDisk ( CBlock block,
const FlatFilePos pos,
const Consensus::Params params 
)

Functions for disk access for blocks.

Definition at line 33 of file blockdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadBlockFromDisk() [2/2]

bool ReadBlockFromDisk ( CBlock block,
const CBlockIndex pindex,
const Consensus::Params params 
)

Definition at line 61 of file blockdb.cpp.

Here is the call graph for this function:

◆ UndoFileSeq()

FlatFileSeq UndoFileSeq ( )

Definition at line 16 of file blockdb.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ cs_main

RecursiveMutex cs_main

Global state.

Mutex to guard access to validation specific variables, such as reading or changing the chainstate.

This may also need to be locked when updating the transaction pool, e.g. on AcceptToMemoryPool. See CTxMemPool::cs comment for details.

The transaction pool has a separate lock to allow reading from it and the chainstate at the same time.

Definition at line 95 of file validation.cpp.