Bitcoin ABC 0.30.3
P2P Digital Currency
Classes | Enumerations | Functions | Variables
kernel Namespace Reference

Classes

struct  BlockManagerOpts
 An options struct for BlockManager, more ergonomically referred to as BlockManager::Options due to the using-declaration in BlockManager. More...
 
struct  CCoinsStats
 
struct  ChainstateManagerOpts
 An options struct for ChainstateManager, more ergonomically referred to as ChainstateManager::Options due to the using-declaration in ChainstateManager. More...
 
struct  MemPoolOptions
 Options struct containing options for constructing a CTxMemPool. More...
 
class  Notifications
 A base class defining functions for notifying about certain kernel events. More...
 
struct  ValidationCacheSizes
 

Enumerations

enum class  CoinStatsHashType { HASH_SERIALIZED , MUHASH , NONE }
 

Functions

uint64_t GetBogoSize (const CScript &script_pub_key)
 
CDataStream TxOutSer (const COutPoint &outpoint, const Coin &coin)
 
static void ApplyHash (HashWriter &ss, const TxId &txid, const std::map< uint32_t, Coin > &outputs)
 Warning: be very careful when changing this! assumeutxo and UTXO snapshot validation commitments are reliant on the hash constructed by this function. More...
 
static void ApplyHash (std::nullptr_t, const TxId &txid, const std::map< uint32_t, Coin > &outputs)
 
static void ApplyHash (MuHash3072 &muhash, const TxId &txid, const std::map< uint32_t, Coin > &outputs)
 
static void ApplyStats (CCoinsStats &stats, const TxId &txid, const std::map< uint32_t, Coin > &outputs)
 
template<typename T >
static bool ComputeUTXOStats (CCoinsView *view, CCoinsStats &stats, T hash_obj, const std::function< void()> &interruption_point)
 Calculate statistics about the unspent transaction output set. More...
 
std::optional< CCoinsStatsComputeUTXOStats (CoinStatsHashType hash_type, CCoinsView *view, node::BlockManager &blockman, const std::function< void()> &interruption_point)
 
static void PrepareHash (HashWriter &ss, const CCoinsStats &stats)
 
static void PrepareHash (MuHash3072 &muhash, CCoinsStats &stats)
 
static void PrepareHash (std::nullptr_t, CCoinsStats &stats)
 
static void FinalizeHash (HashWriter &ss, CCoinsStats &stats)
 
static void FinalizeHash (MuHash3072 &muhash, CCoinsStats &stats)
 
static void FinalizeHash (std::nullptr_t, CCoinsStats &stats)
 
bool LoadMempool (CTxMemPool &pool, const fs::path &load_path, Chainstate &active_chainstate, FopenFn mockable_fopen_function)
 
bool DumpMempool (const CTxMemPool &pool, const fs::path &dump_path, FopenFn mockable_fopen_function, bool skip_file_commit)
 
bool DumpMempool (const CTxMemPool &pool, const fs::path &dump_path, fsbridge::FopenFn mockable_fopen_function=fsbridge::fopen, bool skip_file_commit=false)
 Dump the mempool to disk. More...
 
bool LoadMempool (CTxMemPool &pool, const fs::path &load_path, Chainstate &active_chainstate, fsbridge::FopenFn mockable_fopen_function=fsbridge::fopen)
 Load the mempool from disk. More...
 

Variables

static constexpr bool DEFAULT_STOPAFTERBLOCKIMPORT {false}
 
static const uint64_t MEMPOOL_DUMP_VERSION = 1
 

Enumeration Type Documentation

◆ CoinStatsHashType

enum class kernel::CoinStatsHashType
strong
Enumerator
HASH_SERIALIZED 
MUHASH 
NONE 

Definition at line 23 of file coinstats.h.

Function Documentation

◆ ApplyHash() [1/3]

static void kernel::ApplyHash ( HashWriter ss,
const TxId txid,
const std::map< uint32_t, Coin > &  outputs 
)
static

Warning: be very careful when changing this! assumeutxo and UTXO snapshot validation commitments are reliant on the hash constructed by this function.

If the construction of this hash is changed, it will invalidate existing UTXO snapshots. This will not result in any kind of consensus failure, but it will force clients that were expecting to make use of assumeutxo to do traditional IBD instead.

It is also possible, though very unlikely, that a change in this construction could cause a previously invalid (and potentially malicious) UTXO snapshot to be considered valid.

Definition at line 48 of file coinstats.cpp.

Here is the caller graph for this function:

◆ ApplyHash() [2/3]

static void kernel::ApplyHash ( MuHash3072 muhash,
const TxId txid,
const std::map< uint32_t, Coin > &  outputs 
)
static

Definition at line 70 of file coinstats.cpp.

Here is the call graph for this function:

◆ ApplyHash() [3/3]

static void kernel::ApplyHash ( std::nullptr_t  ,
const TxId txid,
const std::map< uint32_t, Coin > &  outputs 
)
static

Definition at line 67 of file coinstats.cpp.

◆ ApplyStats()

static void kernel::ApplyStats ( CCoinsStats stats,
const TxId txid,
const std::map< uint32_t, Coin > &  outputs 
)
static

Definition at line 79 of file coinstats.cpp.

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

◆ ComputeUTXOStats() [1/2]

template<typename T >
static bool kernel::ComputeUTXOStats ( CCoinsView view,
CCoinsStats stats,
hash_obj,
const std::function< void()> &  interruption_point 
)
static

Calculate statistics about the unspent transaction output set.

Definition at line 92 of file coinstats.cpp.

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

◆ ComputeUTXOStats() [2/2]

std::optional< CCoinsStats > kernel::ComputeUTXOStats ( CoinStatsHashType  hash_type,
CCoinsView view,
node::BlockManager blockman,
const std::function< void()> &  interruption_point 
)

Definition at line 132 of file coinstats.cpp.

Here is the call graph for this function:

◆ DumpMempool() [1/2]

bool kernel::DumpMempool ( const CTxMemPool pool,
const fs::path dump_path,
FopenFn  mockable_fopen_function,
bool  skip_file_commit 
)

Definition at line 143 of file mempool_persist.cpp.

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

◆ DumpMempool() [2/2]

bool kernel::DumpMempool ( const CTxMemPool pool,
const fs::path dump_path,
fsbridge::FopenFn  mockable_fopen_function = fsbridge::fopen,
bool  skip_file_commit = false 
)

Dump the mempool to disk.

◆ FinalizeHash() [1/3]

static void kernel::FinalizeHash ( HashWriter ss,
CCoinsStats stats 
)
static

Definition at line 172 of file coinstats.cpp.

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

◆ FinalizeHash() [2/3]

static void kernel::FinalizeHash ( MuHash3072 muhash,
CCoinsStats stats 
)
static

Definition at line 175 of file coinstats.cpp.

Here is the call graph for this function:

◆ FinalizeHash() [3/3]

static void kernel::FinalizeHash ( std::nullptr_t  ,
CCoinsStats stats 
)
static

Definition at line 180 of file coinstats.cpp.

◆ GetBogoSize()

uint64_t kernel::GetBogoSize ( const CScript script_pub_key)

Definition at line 22 of file coinstats.cpp.

Here is the caller graph for this function:

◆ LoadMempool() [1/2]

bool kernel::LoadMempool ( CTxMemPool pool,
const fs::path load_path,
Chainstate active_chainstate,
FopenFn  mockable_fopen_function 
)

Definition at line 39 of file mempool_persist.cpp.

Here is the call graph for this function:

◆ LoadMempool() [2/2]

bool kernel::LoadMempool ( CTxMemPool pool,
const fs::path load_path,
Chainstate active_chainstate,
fsbridge::FopenFn  mockable_fopen_function = fsbridge::fopen 
)

Load the mempool from disk.

◆ PrepareHash() [1/3]

static void kernel::PrepareHash ( HashWriter ss,
const CCoinsStats stats 
)
static

Definition at line 165 of file coinstats.cpp.

Here is the caller graph for this function:

◆ PrepareHash() [2/3]

static void kernel::PrepareHash ( MuHash3072 muhash,
CCoinsStats stats 
)
static

Definition at line 169 of file coinstats.cpp.

◆ PrepareHash() [3/3]

static void kernel::PrepareHash ( std::nullptr_t  ,
CCoinsStats stats 
)
static

Definition at line 170 of file coinstats.cpp.

◆ TxOutSer()

CDataStream kernel::TxOutSer ( const COutPoint outpoint,
const Coin coin 
)

Definition at line 28 of file coinstats.cpp.

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

Variable Documentation

◆ DEFAULT_STOPAFTERBLOCKIMPORT

constexpr bool kernel::DEFAULT_STOPAFTERBLOCKIMPORT {false}
staticconstexpr

Definition at line 16 of file blockmanager_opts.h.

◆ MEMPOOL_DUMP_VERSION

const uint64_t kernel::MEMPOOL_DUMP_VERSION = 1
static

Definition at line 37 of file mempool_persist.cpp.