Bitcoin Core 28.99.0
P2P Digital Currency
Classes | Typedefs | 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...
 
class  BlockTreeDB
 Access to the block database (blocks/index/) 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  Context
 Context struct holding the kernel library's logically global state, and passed to external libbitcoin_kernel functions which need access to this state. More...
 
struct  Interrupted
 Result type for use with std::variant to indicate that an operation should be interrupted. More...
 
struct  MemPoolLimits
 Options struct containing limit options for a CTxMemPool. 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...
 

Typedefs

using InterruptResult = std::variant< std::monostate, Interrupted >
 Simple result type for functions that need to propagate an interrupt status and don't have other return values. More...
 

Enumerations

enum class  CoinStatsHashType { HASH_SERIALIZED , MUHASH , NONE }
 
enum class  Warning { UNKNOWN_NEW_RULES_ACTIVATED , LARGE_WORK_INVALID_CHAIN }
 

Functions

interfaces::BlockInfo MakeBlockInfo (const CBlockIndex *block_index, const CBlock *data=nullptr)
 Return data from block index. More...
 
util::Result< void > SanityChecks (const Context &)
 Ensure a usable environment with all necessary library support. More...
 
uint64_t GetBogoSize (const CScript &script_pub_key)
 
template<typename T >
static void TxOutSer (T &ss, const COutPoint &outpoint, const Coin &coin)
 
static void ApplyCoinHash (HashWriter &ss, const COutPoint &outpoint, const Coin &coin)
 
void ApplyCoinHash (MuHash3072 &muhash, const COutPoint &outpoint, const Coin &coin)
 
void RemoveCoinHash (MuHash3072 &muhash, const COutPoint &outpoint, const Coin &coin)
 
static void ApplyCoinHash (std::nullptr_t, const COutPoint &outpoint, const Coin &coin)
 
template<typename T >
static void ApplyHash (T &hash_obj, const Txid &hash, 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 ApplyStats (CCoinsStats &stats, const uint256 &hash, 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 FinalizeHash (HashWriter &ss, CCoinsStats &stats)
 
static void FinalizeHash (MuHash3072 &muhash, CCoinsStats &stats)
 
static void FinalizeHash (std::nullptr_t, CCoinsStats &stats)
 
template<typename T >
bool IsInterrupted (const T &result)
 

Variables

static constexpr bool DEFAULT_XOR_BLOCKSDIR {true}
 
static constexpr uint8_t DB_BLOCK_FILES {'f'}
 
static constexpr uint8_t DB_BLOCK_INDEX {'b'}
 
static constexpr uint8_t DB_FLAG {'F'}
 
static constexpr uint8_t DB_REINDEX_FLAG {'R'}
 
static constexpr uint8_t DB_LAST_BLOCK {'l'}
 

Typedef Documentation

◆ InterruptResult

using kernel::InterruptResult = typedef std::variant<std::monostate, Interrupted>

Simple result type for functions that need to propagate an interrupt status and don't have other return values.

Definition at line 23 of file notifications_interface.h.

Enumeration Type Documentation

◆ CoinStatsHashType

enum class kernel::CoinStatsHashType
strong
Enumerator
HASH_SERIALIZED 
MUHASH 
NONE 

Definition at line 26 of file coinstats.h.

◆ Warning

enum class kernel::Warning
strong
Enumerator
UNKNOWN_NEW_RULES_ACTIVATED 
LARGE_WORK_INVALID_CHAIN 

Definition at line 9 of file warning.h.

Function Documentation

◆ ApplyCoinHash() [1/3]

static void kernel::ApplyCoinHash ( HashWriter ss,
const COutPoint outpoint,
const Coin coin 
)
static

Definition at line 58 of file coinstats.cpp.

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

◆ ApplyCoinHash() [2/3]

void kernel::ApplyCoinHash ( MuHash3072 muhash,
const COutPoint outpoint,
const Coin coin 
)

Definition at line 63 of file coinstats.cpp.

Here is the call graph for this function:

◆ ApplyCoinHash() [3/3]

static void kernel::ApplyCoinHash ( std::nullptr_t  ,
const COutPoint outpoint,
const Coin coin 
)
static

Definition at line 77 of file coinstats.cpp.

◆ ApplyHash()

template<typename T >
static void kernel::ApplyHash ( T &  hash_obj,
const Txid hash,
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 92 of file coinstats.cpp.

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

◆ ApplyStats()

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

Definition at line 101 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 116 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 154 of file coinstats.cpp.

Here is the call graph for this function:

◆ FinalizeHash() [1/3]

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

Definition at line 182 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 186 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 192 of file coinstats.cpp.

◆ GetBogoSize()

uint64_t kernel::GetBogoSize ( const CScript script_pub_key)

Definition at line 40 of file coinstats.cpp.

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

◆ IsInterrupted()

template<typename T >
bool kernel::IsInterrupted ( const T &  result)

Definition at line 26 of file notifications_interface.h.

◆ MakeBlockInfo()

interfaces::BlockInfo kernel::MakeBlockInfo ( const CBlockIndex index,
const CBlock data 
)

Return data from block index.

Definition at line 14 of file chain.cpp.

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

◆ RemoveCoinHash()

void kernel::RemoveCoinHash ( MuHash3072 muhash,
const COutPoint outpoint,
const Coin coin 
)

Definition at line 70 of file coinstats.cpp.

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

◆ SanityChecks()

util::Result< void > kernel::SanityChecks ( const Context )

Ensure a usable environment with all necessary library support.

Definition at line 15 of file checks.cpp.

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

◆ TxOutSer()

template<typename T >
static void kernel::TxOutSer ( T &  ss,
const COutPoint outpoint,
const Coin coin 
)
static

Definition at line 51 of file coinstats.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ DB_BLOCK_FILES

constexpr uint8_t kernel::DB_BLOCK_FILES {'f'}
staticconstexpr

Definition at line 44 of file blockstorage.cpp.

◆ DB_BLOCK_INDEX

constexpr uint8_t kernel::DB_BLOCK_INDEX {'b'}
staticconstexpr

Definition at line 45 of file blockstorage.cpp.

◆ DB_FLAG

constexpr uint8_t kernel::DB_FLAG {'F'}
staticconstexpr

Definition at line 46 of file blockstorage.cpp.

◆ DB_LAST_BLOCK

constexpr uint8_t kernel::DB_LAST_BLOCK {'l'}
staticconstexpr

Definition at line 48 of file blockstorage.cpp.

◆ DB_REINDEX_FLAG

constexpr uint8_t kernel::DB_REINDEX_FLAG {'R'}
staticconstexpr

Definition at line 47 of file blockstorage.cpp.

◆ DEFAULT_XOR_BLOCKSDIR

constexpr bool kernel::DEFAULT_XOR_BLOCKSDIR {true}
staticconstexpr

Definition at line 17 of file blockmanager_opts.h.