Bitcoin Core 32.99.0
P2P Digital Currency
Classes | Namespaces | Macros | Functions | Variables
bitcoinkernel.cpp File Reference
#include <kernel/bitcoinkernel.h>
#include <chain.h>
#include <coins.h>
#include <consensus/tx_check.h>
#include <consensus/validation.h>
#include <dbwrapper.h>
#include <kernel/caches.h>
#include <kernel/chainparams.h>
#include <kernel/checks.h>
#include <kernel/context.h>
#include <kernel/notifications_interface.h>
#include <kernel/warning.h>
#include <logging.h>
#include <node/blockstorage.h>
#include <node/chainstate.h>
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <script/interpreter.h>
#include <script/script.h>
#include <script/verify_flags.h>
#include <serialize.h>
#include <streams.h>
#include <sync.h>
#include <uint256.h>
#include <undo.h>
#include <util/check.h>
#include <util/fs.h>
#include <util/result.h>
#include <util/signalinterrupt.h>
#include <util/task_runner.h>
#include <util/time.h>
#include <util/translation.h>
#include <validation.h>
#include <validationinterface.h>
#include <cstddef>
#include <cstring>
#include <exception>
#include <functional>
#include <limits>
#include <list>
#include <memory>
#include <optional>
#include <span>
#include <stdexcept>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
Include dependency graph for bitcoinkernel.cpp:

Go to the source code of this file.

Classes

struct  btck_BlockTreeEntry
 
struct  btck_Block
 
struct  btck_BlockValidationState
 
struct  btck_TxValidationState
 
struct  btck_Transaction
 
struct  btck_TransactionOutput
 
struct  btck_ScriptPubkey
 
struct  btck_LoggingConnection
 
struct  btck_ContextOptions
 
struct  btck_Context
 
struct  btck_ChainParameters
 
struct  btck_ChainstateManagerOptions
 
struct  btck_ChainstateManager
 
struct  btck_Chain
 
struct  btck_BlockSpentOutputs
 
struct  btck_TransactionSpentOutputs
 
struct  btck_Coin
 
struct  btck_BlockHash
 
struct  btck_TransactionInput
 
struct  btck_WitnessStack
 
struct  btck_TransactionOutPoint
 
struct  btck_Txid
 
struct  btck_Wtxid
 
struct  btck_PrecomputedTransactionData
 
struct  btck_BlockHeader
 
struct  btck_ConsensusParams
 

Namespaces

namespace  Consensus
 Transaction validation functions.
 

Macros

#define BITCOINKERNEL_BUILD
 

Functions

btck_Transaction * btck_transaction_create (const void *raw_transaction, size_t raw_transaction_len)
 Create a new transaction from the serialized data. More...
 
size_t btck_transaction_count_outputs (const btck_Transaction *transaction)
 Get the number of outputs of a transaction. More...
 
const btck_TransactionOutput * btck_transaction_get_output_at (const btck_Transaction *transaction, size_t output_index)
 Get the transaction outputs at the provided index. More...
 
size_t btck_transaction_count_inputs (const btck_Transaction *transaction)
 Get the number of inputs of a transaction. More...
 
const btck_TransactionInput * btck_transaction_get_input_at (const btck_Transaction *transaction, size_t input_index)
 Get the transaction input at the provided index. More...
 
uint32_t btck_transaction_get_version (const btck_Transaction *transaction)
 Get a transaction's version. More...
 
uint32_t btck_transaction_get_locktime (const btck_Transaction *transaction)
 Get a transaction's nLockTime value. More...
 
const btck_Txid * btck_transaction_get_txid (const btck_Transaction *transaction)
 Get the txid of a transaction. More...
 
int btck_transaction_has_witness (const btck_Transaction *transaction)
 Check whether a transaction has witness data. More...
 
const btck_Wtxid * btck_transaction_get_wtxid (const btck_Transaction *transaction)
 Get the wtxid of a transaction. More...
 
btck_Transaction * btck_transaction_copy (const btck_Transaction *transaction)
 Copy a transaction. More...
 
int btck_transaction_to_bytes (const btck_Transaction *transaction, btck_WriteBytes writer, void *user_data)
 
void btck_transaction_destroy (btck_Transaction *transaction)
 Destroy the transaction. More...
 
btck_ScriptPubkey * btck_script_pubkey_create (const void *script_pubkey, size_t script_pubkey_len)
 Create a script pubkey from serialized data. More...
 
int btck_script_pubkey_to_bytes (const btck_ScriptPubkey *script_pubkey_, btck_WriteBytes writer, void *user_data)
 
btck_ScriptPubkey * btck_script_pubkey_copy (const btck_ScriptPubkey *script_pubkey)
 Copy a script pubkey. More...
 
void btck_script_pubkey_destroy (btck_ScriptPubkey *script_pubkey)
 Destroy the script pubkey. More...
 
btck_TransactionOutput * btck_transaction_output_create (const btck_ScriptPubkey *script_pubkey, int64_t amount)
 Create a transaction output from a script pubkey and an amount. More...
 
btck_TransactionOutput * btck_transaction_output_copy (const btck_TransactionOutput *output)
 Copy a transaction output. More...
 
const btck_ScriptPubkey * btck_transaction_output_get_script_pubkey (const btck_TransactionOutput *output)
 Get the script pubkey of the output. More...
 
int64_t btck_transaction_output_get_amount (const btck_TransactionOutput *output)
 Get the amount in the output. More...
 
void btck_transaction_output_destroy (btck_TransactionOutput *output)
 Destroy the transaction output. More...
 
btck_PrecomputedTransactionData * btck_precomputed_transaction_data_create (const btck_Transaction *tx_to, const btck_TransactionOutput **spent_outputs_, size_t spent_outputs_len)
 Create precomputed transaction data for script verification. More...
 
btck_PrecomputedTransactionData * btck_precomputed_transaction_data_copy (const btck_PrecomputedTransactionData *precomputed_txdata)
 Copy precomputed transaction data. More...
 
void btck_precomputed_transaction_data_destroy (btck_PrecomputedTransactionData *precomputed_txdata)
 Destroy the precomputed transaction data. More...
 
int btck_script_pubkey_verify (const btck_ScriptPubkey *script_pubkey, const int64_t amount, const btck_Transaction *tx_to, const btck_PrecomputedTransactionData *precomputed_txdata, const unsigned int input_index, const btck_ScriptVerificationFlags flags, btck_ScriptVerifyStatus *status)
 
btck_TransactionInput * btck_transaction_input_copy (const btck_TransactionInput *input)
 Copy a transaction input. More...
 
const btck_TransactionOutPoint * btck_transaction_input_get_out_point (const btck_TransactionInput *input)
 Get the transaction out point. More...
 
uint32_t btck_transaction_input_get_sequence (const btck_TransactionInput *input)
 Get a transaction input's nSequence value. More...
 
const btck_WitnessStack * btck_transaction_input_get_witness_stack (const btck_TransactionInput *input)
 Get the witness stack of a transaction input. More...
 
int btck_transaction_input_get_script_sig (const btck_TransactionInput *input, btck_WriteBytes writer, void *user_data)
 
void btck_transaction_input_destroy (btck_TransactionInput *input)
 Destroy the transaction input. More...
 
size_t btck_witness_stack_count_items (const btck_WitnessStack *witness_stack)
 Return the number of items in a witness stack. More...
 
int btck_witness_stack_get_item_at (const btck_WitnessStack *witness_stack, size_t index, btck_WriteBytes writer, void *user_data)
 
btck_WitnessStack * btck_witness_stack_copy (const btck_WitnessStack *witness_stack)
 Copy a witness stack. More...
 
void btck_witness_stack_destroy (btck_WitnessStack *witness_stack)
 Destroy the witness stack. More...
 
btck_TransactionOutPoint * btck_transaction_out_point_copy (const btck_TransactionOutPoint *out_point)
 Copy a transaction out point. More...
 
uint32_t btck_transaction_out_point_get_index (const btck_TransactionOutPoint *out_point)
 Get the output position from the transaction out point. More...
 
const btck_Txid * btck_transaction_out_point_get_txid (const btck_TransactionOutPoint *out_point)
 Get the txid from the transaction out point. More...
 
void btck_transaction_out_point_destroy (btck_TransactionOutPoint *out_point)
 Destroy the transaction out point. More...
 
btck_Txid * btck_txid_copy (const btck_Txid *txid)
 Copy a txid. More...
 
void btck_txid_to_bytes (const btck_Txid *txid, unsigned char output[32])
 
int btck_txid_equals (const btck_Txid *txid1, const btck_Txid *txid2)
 
void btck_txid_destroy (btck_Txid *txid)
 Destroy the txid. More...
 
btck_Wtxid * btck_wtxid_copy (const btck_Wtxid *wtxid)
 Copy a wtxid. More...
 
void btck_wtxid_to_bytes (const btck_Wtxid *wtxid, unsigned char output[32])
 
int btck_wtxid_equals (const btck_Wtxid *wtxid1, const btck_Wtxid *wtxid2)
 
void btck_wtxid_destroy (btck_Wtxid *wtxid)
 Destroy the wtxid. More...
 
void btck_logging_set_options (const btck_LoggingOptions options)
 Set some options for the global internal logger. More...
 
void btck_logging_set_level_category (btck_LogCategory category, btck_LogLevel level)
 Set the log level of the global internal logger. More...
 
void btck_logging_enable_category (btck_LogCategory category)
 Enable a specific log category for the global internal logger. More...
 
void btck_logging_disable_category (btck_LogCategory category)
 Disable a specific log category for the global internal logger. More...
 
void btck_logging_disable ()
 This disables the global internal logger. More...
 
btck_LoggingConnection * btck_logging_connection_create (btck_LogCallback callback, void *user_data, btck_DestroyCallback user_data_destroy_callback)
 Start logging messages through the provided callback. More...
 
void btck_logging_connection_destroy (btck_LoggingConnection *connection)
 Stop logging and destroy the logging connection. More...
 
btck_ChainParameters * btck_chain_parameters_create (const btck_ChainType chain_type)
 Creates a chain parameters struct with default parameters based on the passed in chain type. More...
 
btck_ChainParameters * btck_chain_parameters_create_signet (const void *challenge, size_t challenge_len)
 Create a signet chain parameters struct with a user-provided challenge. More...
 
btck_ChainParameters * btck_chain_parameters_copy (const btck_ChainParameters *chain_parameters)
 Copy the chain parameters. More...
 
const btck_ConsensusParams * btck_chain_parameters_get_consensus_params (const btck_ChainParameters *chain_parameters)
 Get btck_ConsensusParams from btck_ChainParameters. More...
 
void btck_chain_parameters_destroy (btck_ChainParameters *chain_parameters)
 Destroy the chain parameters. More...
 
btck_ContextOptions * btck_context_options_create ()
 Creates an empty context options. More...
 
void btck_context_options_set_chainparams (btck_ContextOptions *options, const btck_ChainParameters *chain_parameters)
 
void btck_context_options_set_notifications (btck_ContextOptions *options, btck_NotificationInterfaceCallbacks notifications)
 Set the kernel notifications for the context options. More...
 
void btck_context_options_set_validation_interface (btck_ContextOptions *options, btck_ValidationInterfaceCallbacks vi_cbs)
 Set the validation interface callbacks for the context options. More...
 
void btck_context_options_destroy (btck_ContextOptions *options)
 Destroy the context options. More...
 
btck_Context * btck_context_create (const btck_ContextOptions *options)
 Create a new kernel context. More...
 
btck_Context * btck_context_copy (const btck_Context *context)
 Copy the context. More...
 
int btck_context_interrupt (btck_Context *context)
 Interrupt can be used to halt long-running validation functions like when reindexing, importing or processing blocks. More...
 
void btck_context_destroy (btck_Context *context)
 Destroy the context. More...
 
const btck_BlockTreeEntry * btck_block_tree_entry_get_previous (const btck_BlockTreeEntry *entry)
 Returns the previous block tree entry in the tree, or null if the current block tree entry is the genesis block. More...
 
const btck_BlockTreeEntry * btck_block_tree_entry_get_ancestor (const btck_BlockTreeEntry *block_tree_entry, int32_t height)
 Return the ancestor of a btck_BlockTreeEntry at the given height. More...
 
btck_BlockValidationState * btck_block_validation_state_create ()
 Create a new btck_BlockValidationState. More...
 
btck_BlockValidationState * btck_block_validation_state_copy (const btck_BlockValidationState *state)
 Copies the btck_BlockValidationState. More...
 
void btck_block_validation_state_destroy (btck_BlockValidationState *state)
 Destroy the btck_BlockValidationState. More...
 
btck_ValidationMode btck_block_validation_state_get_validation_mode (const btck_BlockValidationState *block_validation_state_)
 Returns the validation mode from an opaque btck_BlockValidationState pointer. More...
 
btck_BlockValidationResult btck_block_validation_state_get_block_validation_result (const btck_BlockValidationState *block_validation_state_)
 Returns the validation result from an opaque btck_BlockValidationState pointer. More...
 
btck_ChainstateManagerOptions * btck_chainstate_manager_options_create (const btck_Context *context, const char *data_dir, size_t data_dir_len, const char *blocks_dir, size_t blocks_dir_len)
 Create options for the chainstate manager. More...
 
void btck_chainstate_manager_options_set_worker_threads_num (btck_ChainstateManagerOptions *opts, int worker_threads)
 Set the number of available worker threads used during validation. More...
 
int btck_chainstate_manager_options_set_database_cache_bytes (btck_ChainstateManagerOptions *chainman_opts, uint64_t database_cache_bytes)
 Set the total database cache used by the chainstate manager. More...
 
void btck_chainstate_manager_options_destroy (btck_ChainstateManagerOptions *options)
 Destroy the chainstate manager options. More...
 
int btck_chainstate_manager_options_set_wipe_dbs (btck_ChainstateManagerOptions *chainman_opts, int wipe_block_tree_db, int wipe_chainstate_db)
 Sets wipe db in the options. More...
 
void btck_chainstate_manager_options_update_block_tree_db_in_memory (btck_ChainstateManagerOptions *chainman_opts, int block_tree_db_in_memory)
 Sets block tree db in memory in the options. More...
 
void btck_chainstate_manager_options_update_chainstate_db_in_memory (btck_ChainstateManagerOptions *chainman_opts, int chainstate_db_in_memory)
 Sets chainstate db in memory in the options. More...
 
btck_ChainstateManager * btck_chainstate_manager_create (const btck_ChainstateManagerOptions *chainman_opts)
 Create a chainstate manager. More...
 
const btck_BlockTreeEntry * btck_chainstate_manager_get_block_tree_entry_by_hash (const btck_ChainstateManager *chainman, const btck_BlockHash *block_hash)
 
const btck_BlockTreeEntry * btck_chainstate_manager_get_best_entry (const btck_ChainstateManager *chainstate_manager)
 Get the btck_BlockTreeEntry whose associated btck_BlockHeader has the most known cumulative proof of work. More...
 
void btck_chainstate_manager_destroy (btck_ChainstateManager *chainman)
 Destroy the chainstate manager. More...
 
int btck_chainstate_manager_import_blocks (btck_ChainstateManager *chainman, const char **block_file_paths_data, size_t *block_file_paths_lens, size_t block_file_paths_data_len)
 Triggers the start of a reindex if the wipe options were previously set for the chainstate manager. More...
 
btck_Block * btck_block_create (const void *raw_block, size_t raw_block_length)
 Parse a serialized raw block into a new block object. More...
 
btck_Block * btck_block_copy (const btck_Block *block)
 Copy a block. More...
 
int btck_block_check (const btck_Block *block, const btck_ConsensusParams *consensus_params, btck_BlockCheckFlags flags, btck_BlockValidationState *validation_state)
 
size_t btck_block_count_transactions (const btck_Block *block)
 Count the number of transactions contained in a block. More...
 
const btck_Transaction * btck_block_get_transaction_at (const btck_Block *block, size_t index)
 Get the transaction at the provided index. More...
 
btck_BlockHeader * btck_block_get_header (const btck_Block *block)
 Get the btck_BlockHeader from the block. More...
 
int btck_block_to_bytes (const btck_Block *block, btck_WriteBytes writer, void *user_data)
 
btck_BlockHash * btck_block_get_hash (const btck_Block *block)
 Calculate and return the hash of a block. More...
 
void btck_block_destroy (btck_Block *block)
 Destroy the block. More...
 
btck_Block * btck_block_read (const btck_ChainstateManager *chainman, const btck_BlockTreeEntry *entry)
 
btck_BlockHeader * btck_block_tree_entry_get_block_header (const btck_BlockTreeEntry *entry)
 Return the btck_BlockHeader associated with this entry. More...
 
int32_t btck_block_tree_entry_get_height (const btck_BlockTreeEntry *entry)
 Return the height of a certain block tree entry. More...
 
const btck_BlockHash * btck_block_tree_entry_get_block_hash (const btck_BlockTreeEntry *entry)
 Return the block hash associated with a block tree entry. More...
 
int btck_block_tree_entry_equals (const btck_BlockTreeEntry *entry1, const btck_BlockTreeEntry *entry2)
 
btck_BlockHash * btck_block_hash_create (const unsigned char block_hash[32])
 Create a block hash from its raw data. More...
 
btck_BlockHash * btck_block_hash_copy (const btck_BlockHash *block_hash)
 Copy a block hash. More...
 
void btck_block_hash_to_bytes (const btck_BlockHash *block_hash, unsigned char output[32])
 
int btck_block_hash_equals (const btck_BlockHash *hash1, const btck_BlockHash *hash2)
 
void btck_block_hash_destroy (btck_BlockHash *hash)
 Destroy the block hash. More...
 
btck_BlockSpentOutputs * btck_block_spent_outputs_read (const btck_ChainstateManager *chainman, const btck_BlockTreeEntry *entry)
 
btck_BlockSpentOutputs * btck_block_spent_outputs_copy (const btck_BlockSpentOutputs *block_spent_outputs)
 Copy a block's spent outputs. More...
 
size_t btck_block_spent_outputs_count (const btck_BlockSpentOutputs *block_spent_outputs)
 Returns the number of transaction spent outputs whose data is contained in block spent outputs. More...
 
const btck_TransactionSpentOutputs * btck_block_spent_outputs_get_transaction_spent_outputs_at (const btck_BlockSpentOutputs *block_spent_outputs, size_t transaction_index)
 Returns a transaction spent outputs contained in the block spent outputs at a certain index. More...
 
void btck_block_spent_outputs_destroy (btck_BlockSpentOutputs *block_spent_outputs)
 Destroy the block spent outputs. More...
 
btck_TransactionSpentOutputs * btck_transaction_spent_outputs_copy (const btck_TransactionSpentOutputs *transaction_spent_outputs)
 Copy a transaction's spent outputs. More...
 
size_t btck_transaction_spent_outputs_count (const btck_TransactionSpentOutputs *transaction_spent_outputs)
 Returns the number of previous transaction outputs contained in the transaction spent outputs data. More...
 
void btck_transaction_spent_outputs_destroy (btck_TransactionSpentOutputs *transaction_spent_outputs)
 Destroy the transaction spent outputs. More...
 
const btck_Coin * btck_transaction_spent_outputs_get_coin_at (const btck_TransactionSpentOutputs *transaction_spent_outputs, size_t coin_index)
 Returns a coin contained in the transaction spent outputs at a certain index. More...
 
btck_Coin * btck_coin_copy (const btck_Coin *coin)
 Copy a coin. More...
 
uint32_t btck_coin_confirmation_height (const btck_Coin *coin)
 Returns the block height where the transaction that created this coin was included in. More...
 
int btck_coin_is_coinbase (const btck_Coin *coin)
 Returns whether the containing transaction was a coinbase. More...
 
const btck_TransactionOutput * btck_coin_get_output (const btck_Coin *coin)
 Return the transaction output of a coin. More...
 
void btck_coin_destroy (btck_Coin *coin)
 Destroy the coin. More...
 
int btck_chainstate_manager_process_block (btck_ChainstateManager *chainman, const btck_Block *block, int *_new_block)
 
btck_BlockValidationState * btck_chainstate_manager_process_block_header (btck_ChainstateManager *chainstate_manager, const btck_BlockHeader *header)
 
const btck_Chain * btck_chainstate_manager_get_active_chain (const btck_ChainstateManager *chainman)
 Returns the best known currently active chain. More...
 
int32_t btck_chain_get_height (const btck_Chain *chain)
 Return the height of the tip of the chain. More...
 
const btck_BlockTreeEntry * btck_chain_get_by_height (const btck_Chain *chain, int32_t height)
 Retrieve a block tree entry by its height in the currently active chain. More...
 
int btck_chain_contains (const btck_Chain *chain, const btck_BlockTreeEntry *entry)
 
btck_BlockHeader * btck_block_header_create (const void *raw_block_header, size_t raw_block_header_len)
 Create a btck_BlockHeader from serialized data. More...
 
btck_BlockHeader * btck_block_header_copy (const btck_BlockHeader *header)
 Copy a btck_BlockHeader. More...
 
btck_BlockHash * btck_block_header_get_hash (const btck_BlockHeader *header)
 Get the btck_BlockHash. More...
 
const btck_BlockHash * btck_block_header_get_prev_hash (const btck_BlockHeader *header)
 Get the previous btck_BlockHash from btck_BlockHeader. More...
 
void btck_block_header_get_merkle_root (const btck_BlockHeader *header, unsigned char output[32])
 
uint32_t btck_block_header_get_timestamp (const btck_BlockHeader *header)
 Get the timestamp from btck_BlockHeader. More...
 
uint32_t btck_block_header_get_bits (const btck_BlockHeader *header)
 Get the nBits difficulty target from btck_BlockHeader. More...
 
int32_t btck_block_header_get_version (const btck_BlockHeader *header)
 Get the version from btck_BlockHeader. More...
 
uint32_t btck_block_header_get_nonce (const btck_BlockHeader *header)
 Get the nonce from btck_BlockHeader. More...
 
int btck_block_header_to_bytes (const btck_BlockHeader *header, unsigned char output[80])
 
void btck_block_header_destroy (btck_BlockHeader *header)
 Destroy the btck_BlockHeader. More...
 
btck_ValidationMode btck_tx_validation_state_get_validation_mode (const btck_TxValidationState *state_)
 Returns the validation mode from an opaque btck_TxValidationState pointer. More...
 
btck_TxValidationState * btck_tx_validation_state_create ()
 Create a new btck_TxValidationState. More...
 
btck_TxValidationResult btck_tx_validation_state_get_tx_validation_result (const btck_TxValidationState *state_)
 Returns the validation result from an opaque btck_TxValidationState pointer. More...
 
void btck_tx_validation_state_destroy (btck_TxValidationState *state)
 Destroy the btck_TxValidationState. More...
 
int btck_transaction_check (const btck_Transaction *tx, btck_TxValidationState *validation_state)
 
int btck_set_mock_time (int64_t timestamp)
 Override the current time with a fixed timestamp for testing. More...
 

Variables

const TranslateFn G_TRANSLATION_FUN {nullptr}
 
static const kernel::Context btck_context_static {}
 

Macro Definition Documentation

◆ BITCOINKERNEL_BUILD

#define BITCOINKERNEL_BUILD

Definition at line 5 of file bitcoinkernel.cpp.

Function Documentation

◆ btck_block_check()

int btck_block_check ( const btck_Block *  block,
const btck_ConsensusParams *  consensus_params,
btck_BlockCheckFlags  flags,
btck_BlockValidationState *  validation_state 
)

Definition at line 1236 of file bitcoinkernel.cpp.

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

◆ btck_block_copy()

btck_Block * btck_block_copy ( const btck_Block *  block)

Copy a block.

Blocks are reference counted, so this just increments the reference count.

Parameters
[in]blockNon-null.
Returns
The copied block.

Definition at line 1231 of file bitcoinkernel.cpp.

◆ btck_block_count_transactions()

size_t btck_block_count_transactions ( const btck_Block *  block)

Count the number of transactions contained in a block.

Parameters
[in]blockNon-null.
Returns
The number of transactions in the block.

Definition at line 1249 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_create()

btck_Block * btck_block_create ( const void *  raw_block,
size_t  raw_block_len 
)

Parse a serialized raw block into a new block object.

Parameters
[in]raw_blockSerialized block.
[in]raw_block_lenLength of the serialized block.
Returns
The allocated block, or null on error.

Definition at line 1214 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_block_destroy()

void btck_block_destroy ( btck_Block *  block)

Destroy the block.

Definition at line 1282 of file bitcoinkernel.cpp.

◆ btck_block_get_hash()

btck_BlockHash * btck_block_get_hash ( const btck_Block *  block)

Calculate and return the hash of a block.

Parameters
[in]blockNon-null.
Returns
The block hash.

Definition at line 1277 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_get_header()

btck_BlockHeader * btck_block_get_header ( const btck_Block *  block)

Get the btck_BlockHeader from the block.

Creates a new btck_BlockHeader object from the block's header data.

Parameters
[in]blockNon-null btck_Block
Returns
btck_BlockHeader.

Definition at line 1260 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_get_transaction_at()

const btck_Transaction * btck_block_get_transaction_at ( const btck_Block *  block,
size_t  transaction_index 
)

Get the transaction at the provided index.

The returned transaction is not owned and depends on the lifetime of the block.

Parameters
[in]blockNon-null.
[in]transaction_indexThe index of the transaction to be retrieved.
Returns
The transaction.

Definition at line 1254 of file bitcoinkernel.cpp.

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

◆ btck_block_hash_copy()

btck_BlockHash * btck_block_hash_copy ( const btck_BlockHash *  block_hash)

Copy a block hash.

Parameters
[in]block_hashNon-null.
Returns
The copied block hash.

Definition at line 1322 of file bitcoinkernel.cpp.

◆ btck_block_hash_create()

btck_BlockHash * btck_block_hash_create ( const unsigned char  block_hash[32])

Create a block hash from its raw data.

Definition at line 1317 of file bitcoinkernel.cpp.

◆ btck_block_hash_destroy()

void btck_block_hash_destroy ( btck_BlockHash *  hash)

Destroy the block hash.

Definition at line 1337 of file bitcoinkernel.cpp.

◆ btck_block_hash_equals()

int btck_block_hash_equals ( const btck_BlockHash *  hash1,
const btck_BlockHash *  hash2 
)

Definition at line 1332 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_hash_to_bytes()

void btck_block_hash_to_bytes ( const btck_BlockHash *  block_hash,
unsigned char  output[32] 
)

Definition at line 1327 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_copy()

btck_BlockHeader * btck_block_header_copy ( const btck_BlockHeader *  header)

Copy a btck_BlockHeader.

Parameters
[in]headerNon-null btck_BlockHeader.
Returns
Copied btck_BlockHeader.

Definition at line 1494 of file bitcoinkernel.cpp.

◆ btck_block_header_create()

btck_BlockHeader * btck_block_header_create ( const void *  raw_block_header,
size_t  raw_block_header_len 
)

Create a btck_BlockHeader from serialized data.

Parameters
[in]raw_block_headerNon-null, serialized header data (80 bytes)
[in]raw_block_header_lenLength of serialized header (must be 80)
Returns
btck_BlockHeader, or null on error.

Definition at line 1478 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_block_header_destroy()

void btck_block_header_destroy ( btck_BlockHeader *  header)

Destroy the btck_BlockHeader.

Definition at line 1544 of file bitcoinkernel.cpp.

◆ btck_block_header_get_bits()

uint32_t btck_block_header_get_bits ( const btck_BlockHeader *  header)

Get the nBits difficulty target from btck_BlockHeader.

Parameters
[in]headerNon-null btck_BlockHeader
Returns
Difficulty target (compact format)

Definition at line 1519 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_get_hash()

btck_BlockHash * btck_block_header_get_hash ( const btck_BlockHeader *  header)

Get the btck_BlockHash.

Parameters
[in]headerNon-null header
Returns
btck_BlockHash.

Definition at line 1499 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_get_merkle_root()

void btck_block_header_get_merkle_root ( const btck_BlockHeader *  header,
unsigned char  output[32] 
)

Definition at line 1509 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_get_nonce()

uint32_t btck_block_header_get_nonce ( const btck_BlockHeader *  header)

Get the nonce from btck_BlockHeader.

Parameters
[in]headerNon-null btck_BlockHeader
Returns
Nonce

Definition at line 1529 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_get_prev_hash()

const btck_BlockHash * btck_block_header_get_prev_hash ( const btck_BlockHeader *  header)

Get the previous btck_BlockHash from btck_BlockHeader.

The returned hash is unowned and only valid for the lifetime of the btck_BlockHeader.

Parameters
[in]headerNon-null btck_BlockHeader
Returns
Previous btck_BlockHash

Definition at line 1504 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_get_timestamp()

uint32_t btck_block_header_get_timestamp ( const btck_BlockHeader *  header)

Get the timestamp from btck_BlockHeader.

Parameters
[in]headerNon-null btck_BlockHeader
Returns
Block timestamp (Unix epoch seconds)

Definition at line 1514 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_get_version()

int32_t btck_block_header_get_version ( const btck_BlockHeader *  header)

Get the version from btck_BlockHeader.

Parameters
[in]headerNon-null btck_BlockHeader
Returns
Block version

Definition at line 1524 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_header_to_bytes()

int btck_block_header_to_bytes ( const btck_BlockHeader *  header,
unsigned char  output[80] 
)

Definition at line 1534 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_read()

btck_Block * btck_block_read ( const btck_ChainstateManager *  chainman,
const btck_BlockTreeEntry *  entry 
)

Definition at line 1287 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_spent_outputs_copy()

btck_BlockSpentOutputs * btck_block_spent_outputs_copy ( const btck_BlockSpentOutputs *  block_spent_outputs)

Copy a block's spent outputs.

Parameters
[in]block_spent_outputsNon-null.
Returns
The copied block spent outputs.

Definition at line 1356 of file bitcoinkernel.cpp.

◆ btck_block_spent_outputs_count()

size_t btck_block_spent_outputs_count ( const btck_BlockSpentOutputs *  block_spent_outputs)

Returns the number of transaction spent outputs whose data is contained in block spent outputs.

Parameters
[in]block_spent_outputsNon-null.
Returns
The number of transaction spent outputs data in the block spent outputs.

Definition at line 1361 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_spent_outputs_destroy()

void btck_block_spent_outputs_destroy ( btck_BlockSpentOutputs *  block_spent_outputs)

Destroy the block spent outputs.

Definition at line 1373 of file bitcoinkernel.cpp.

◆ btck_block_spent_outputs_get_transaction_spent_outputs_at()

const btck_TransactionSpentOutputs * btck_block_spent_outputs_get_transaction_spent_outputs_at ( const btck_BlockSpentOutputs *  block_spent_outputs,
size_t  transaction_spent_outputs_index 
)

Returns a transaction spent outputs contained in the block spent outputs at a certain index.

The returned pointer is unowned and only valid for the lifetime of block_spent_outputs.

Parameters
[in]block_spent_outputsNon-null.
[in]transaction_spent_outputs_indexThe index of the transaction spent outputs within the block spent outputs.
Returns
A transaction spent outputs pointer.

Definition at line 1366 of file bitcoinkernel.cpp.

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

◆ btck_block_spent_outputs_read()

btck_BlockSpentOutputs * btck_block_spent_outputs_read ( const btck_ChainstateManager *  chainman,
const btck_BlockTreeEntry *  entry 
)

Definition at line 1342 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_to_bytes()

int btck_block_to_bytes ( const btck_Block *  block,
btck_WriteBytes  writer,
void *  user_data 
)

Definition at line 1266 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_tree_entry_equals()

int btck_block_tree_entry_equals ( const btck_BlockTreeEntry *  entry1,
const btck_BlockTreeEntry *  entry2 
)

Definition at line 1312 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_tree_entry_get_ancestor()

const btck_BlockTreeEntry * btck_block_tree_entry_get_ancestor ( const btck_BlockTreeEntry *  block_tree_entry,
int32_t  height 
)

Return the ancestor of a btck_BlockTreeEntry at the given height.

Parameters
[in]block_tree_entryNon-null.
[in]heightThe height of the requested ancestor.
Returns
The ancestor at the given height.

Definition at line 991 of file bitcoinkernel.cpp.

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

◆ btck_block_tree_entry_get_block_hash()

const btck_BlockHash * btck_block_tree_entry_get_block_hash ( const btck_BlockTreeEntry *  block_tree_entry)

Return the block hash associated with a block tree entry.

Parameters
[in]block_tree_entryNon-null.
Returns
The block hash.

Definition at line 1307 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_tree_entry_get_block_header()

btck_BlockHeader * btck_block_tree_entry_get_block_header ( const btck_BlockTreeEntry *  block_tree_entry)

Return the btck_BlockHeader associated with this entry.

Parameters
[in]block_tree_entryNon-null.
Returns
btck_BlockHeader.

Definition at line 1297 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_tree_entry_get_height()

int32_t btck_block_tree_entry_get_height ( const btck_BlockTreeEntry *  block_tree_entry)

Return the height of a certain block tree entry.

Parameters
[in]block_tree_entryNon-null.
Returns
The block height.

Definition at line 1302 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_tree_entry_get_previous()

const btck_BlockTreeEntry * btck_block_tree_entry_get_previous ( const btck_BlockTreeEntry *  block_tree_entry)

Returns the previous block tree entry in the tree, or null if the current block tree entry is the genesis block.

Parameters
[in]block_tree_entryNon-null.
Returns
The previous block tree entry, or null on error or if the current block tree entry is the genesis block.

Definition at line 981 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_block_validation_state_copy()

btck_BlockValidationState * btck_block_validation_state_copy ( const btck_BlockValidationState *  block_validation_state)

Copies the btck_BlockValidationState.

Parameters
[in]block_validation_stateNon-null.
Returns
The copied btck_BlockValidationState.

Definition at line 1003 of file bitcoinkernel.cpp.

◆ btck_block_validation_state_create()

btck_BlockValidationState * btck_block_validation_state_create ( )

Create a new btck_BlockValidationState.

Definition at line 998 of file bitcoinkernel.cpp.

◆ btck_block_validation_state_destroy()

void btck_block_validation_state_destroy ( btck_BlockValidationState *  state)

Destroy the btck_BlockValidationState.

Definition at line 1008 of file bitcoinkernel.cpp.

◆ btck_block_validation_state_get_block_validation_result()

btck_BlockValidationResult btck_block_validation_state_get_block_validation_result ( const btck_BlockValidationState *  block_validation_state_)

Returns the validation result from an opaque btck_BlockValidationState pointer.

Definition at line 1021 of file bitcoinkernel.cpp.

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

◆ btck_block_validation_state_get_validation_mode()

btck_ValidationMode btck_block_validation_state_get_validation_mode ( const btck_BlockValidationState *  block_validation_state_)

Returns the validation mode from an opaque btck_BlockValidationState pointer.

Definition at line 1013 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chain_contains()

int btck_chain_contains ( const btck_Chain *  chain,
const btck_BlockTreeEntry *  entry 
)

Definition at line 1472 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chain_get_by_height()

const btck_BlockTreeEntry * btck_chain_get_by_height ( const btck_Chain *  chain,
int32_t  block_height 
)

Retrieve a block tree entry by its height in the currently active chain.

Once retrieved there is no guarantee that it remains in the active chain.

Parameters
[in]chainNon-null.
[in]block_heightHeight in the chain of the to be retrieved block tree entry.
Returns
The block tree entry at a certain height in the currently active chain, or null if the height is out of bounds.

Definition at line 1466 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chain_get_height()

int32_t btck_chain_get_height ( const btck_Chain *  chain)

Return the height of the tip of the chain.

Parameters
[in]chainNon-null.
Returns
The current height.

Definition at line 1460 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chain_parameters_copy()

btck_ChainParameters * btck_chain_parameters_copy ( const btck_ChainParameters *  chain_parameters)

Copy the chain parameters.

Definition at line 909 of file bitcoinkernel.cpp.

◆ btck_chain_parameters_create()

btck_ChainParameters * btck_chain_parameters_create ( btck_ChainType  chain_type)

Creates a chain parameters struct with default parameters based on the passed in chain type.

Parameters
[in]chain_typeControls the chain parameters type created.
Returns
An allocated chain parameters opaque struct.

Definition at line 877 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_chain_parameters_create_signet()

btck_ChainParameters * btck_chain_parameters_create_signet ( const void *  challenge,
size_t  challenge_len 
)

Create a signet chain parameters struct with a user-provided challenge.

Parameters
[in]challengeThe signet challenge value. Blocks must satisfy it in order to be valid.
[in]challenge_lenThe length of the signet challenge.
Returns
An allocated chain parameters opaque struct.

Definition at line 899 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_chain_parameters_destroy()

void btck_chain_parameters_destroy ( btck_ChainParameters *  chain_parameters)

Destroy the chain parameters.

Definition at line 919 of file bitcoinkernel.cpp.

◆ btck_chain_parameters_get_consensus_params()

const btck_ConsensusParams * btck_chain_parameters_get_consensus_params ( const btck_ChainParameters *  chain_parameters)

Get btck_ConsensusParams from btck_ChainParameters.

The returned btck_ConsensusParams pointer is valid only for the lifetime of the btck_ChainParameters object and must not be destroyed by the caller.

Parameters
[in]chain_parametersNon-null.
Returns
The btck_ConsensusParams.

Definition at line 914 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_create()

btck_ChainstateManager * btck_chainstate_manager_create ( const btck_ChainstateManagerOptions *  chainstate_manager_options)

Create a chainstate manager.

This is the main object for many validation tasks as well as for retrieving data from the chain and interacting with its chainstate and indexes.

Parameters
[in]chainstate_manager_optionsNon-null, created by btck_chainstate_manager_options_create.
Returns
The allocated chainstate manager, or null on error.

Definition at line 1123 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_chainstate_manager_destroy()

void btck_chainstate_manager_destroy ( btck_ChainstateManager *  chainman)

Destroy the chainstate manager.

Definition at line 1179 of file bitcoinkernel.cpp.

◆ btck_chainstate_manager_get_active_chain()

const btck_Chain * btck_chainstate_manager_get_active_chain ( const btck_ChainstateManager *  chainstate_manager)

Returns the best known currently active chain.

Its lifetime is dependent on the chainstate manager. It can be thought of as a view on a vector of block tree entries that form the best chain. The returned chain reference always points to the currently active best chain. However, state transitions within the chainstate manager (e.g., processing blocks) will update the chain's contents. Data retrieved from this chain is only consistent up to the point when new data is processed in the chainstate manager. It is the user's responsibility to guard against these inconsistencies.

Parameters
[in]chainstate_managerNon-null.
Returns
The chain.

Definition at line 1455 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_get_best_entry()

const btck_BlockTreeEntry * btck_chainstate_manager_get_best_entry ( const btck_ChainstateManager *  chainstate_manager)

Get the btck_BlockTreeEntry whose associated btck_BlockHeader has the most known cumulative proof of work.

Parameters
[in]chainstate_managerNon-null.
Returns
The btck_BlockTreeEntry, or null if no block headers have been loaded.

Definition at line 1173 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_get_block_tree_entry_by_hash()

const btck_BlockTreeEntry * btck_chainstate_manager_get_block_tree_entry_by_hash ( const btck_ChainstateManager *  chainman,
const btck_BlockHash *  block_hash 
)

Definition at line 1162 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_import_blocks()

int btck_chainstate_manager_import_blocks ( btck_ChainstateManager *  chainstate_manager,
const char **  block_file_paths_data,
size_t *  block_file_paths_lens,
size_t  block_file_paths_data_len 
)

Triggers the start of a reindex if the wipe options were previously set for the chainstate manager.

Can also import an array of existing block files selected by the user.

Parameters
[in]chainstate_managerNon-null.
[in]block_file_paths_dataNullable, array of block files described by their full filesystem paths.
[in]block_file_paths_lensNullable, array containing the lengths of each of the paths.
[in]block_file_paths_data_lenLength of the block_file_paths_data and block_file_paths_len arrays.
Returns
0 if the import blocks call was completed successfully, non-zero otherwise.

Definition at line 1194 of file bitcoinkernel.cpp.

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

◆ btck_chainstate_manager_options_create()

btck_ChainstateManagerOptions * btck_chainstate_manager_options_create ( const btck_Context *  context,
const char *  data_directory,
size_t  data_directory_len,
const char *  blocks_directory,
size_t  blocks_directory_len 
)

Create options for the chainstate manager.

Parameters
[in]contextNon-null, the created options and through it the chainstate manager will associate with this kernel context for the duration of their lifetimes.
[in]data_directoryPath string of the directory containing the chainstate data. If the directory does not exist yet, it will be created.
[in]blocks_directoryPath string of the directory containing the block data. If the directory does not exist yet, it will be created.
Returns
The allocated chainstate manager options, or null on error (e.g. if a path is invalid).

Definition at line 1047 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_chainstate_manager_options_destroy()

void btck_chainstate_manager_options_destroy ( btck_ChainstateManagerOptions *  options)

Destroy the chainstate manager options.

Definition at line 1087 of file bitcoinkernel.cpp.

◆ btck_chainstate_manager_options_set_database_cache_bytes()

int btck_chainstate_manager_options_set_database_cache_bytes ( btck_ChainstateManagerOptions *  chainstate_manager_options,
uint64_t  database_cache_bytes 
)

Set the total database cache used by the chainstate manager.

The total cache is split internally between the block tree database, chainstate database, and in-memory coins cache. If this function is not called, the total cache defaults to 450 MiB.

Parameters
[in]chainstate_manager_optionsNon-null, options to be set.
[in]database_cache_bytesThe total database cache size in bytes. Values below 4 MiB are rejected. On 32-bit systems, values above 1 GiB are also rejected.
Returns
0 if the set was successful, non-zero if the set failed.

Definition at line 1073 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_options_set_wipe_dbs()

int btck_chainstate_manager_options_set_wipe_dbs ( btck_ChainstateManagerOptions *  chainstate_manager_options,
int  wipe_block_tree_db,
int  wipe_chainstate_db 
)

Sets wipe db in the options.

In combination with calling btck_chainstate_manager_import_blocks this triggers either a full reindex, or a reindex of just the chainstate database.

Parameters
[in]chainstate_manager_optionsNon-null, created by btck_chainstate_manager_options_create.
[in]wipe_block_tree_dbSet wipe block tree db. Should only be 1 if wipe_chainstate_db is 1 too.
[in]wipe_chainstate_dbSet wipe chainstate db.
Returns
0 if the set was successful, non-zero if the set failed.
Note
When a wipe is set, the caller must invoke btck_chainstate_manager_import_blocks on the resulting chainstate manager before using it for anything else.

Definition at line 1092 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_options_set_worker_threads_num()

void btck_chainstate_manager_options_set_worker_threads_num ( btck_ChainstateManagerOptions *  chainstate_manager_options,
int  worker_threads 
)

Set the number of available worker threads used during validation.

Parameters
[in]chainstate_manager_optionsNon-null, options to be set.
[in]worker_threadsThe number of worker threads that should be spawned in the thread pool used for validation. When set to 0 no parallel verification is done. The value range is clamped internally between 0 and 15.

Definition at line 1067 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_options_update_block_tree_db_in_memory()

void btck_chainstate_manager_options_update_block_tree_db_in_memory ( btck_ChainstateManagerOptions *  chainstate_manager_options,
int  block_tree_db_in_memory 
)

Sets block tree db in memory in the options.

Parameters
[in]chainstate_manager_optionsNon-null, created by btck_chainstate_manager_options_create.
[in]block_tree_db_in_memorySet block tree db in memory.

Definition at line 1105 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_options_update_chainstate_db_in_memory()

void btck_chainstate_manager_options_update_chainstate_db_in_memory ( btck_ChainstateManagerOptions *  chainstate_manager_options,
int  chainstate_db_in_memory 
)

Sets chainstate db in memory in the options.

Parameters
[in]chainstate_manager_optionsNon-null, created by btck_chainstate_manager_options_create.
[in]chainstate_db_in_memorySet chainstate db in memory.

Definition at line 1114 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_process_block()

int btck_chainstate_manager_process_block ( btck_ChainstateManager *  chainman,
const btck_Block *  block,
int *  _new_block 
)

Definition at line 1425 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chainstate_manager_process_block_header()

btck_BlockValidationState * btck_chainstate_manager_process_block_header ( btck_ChainstateManager *  chainstate_manager,
const btck_BlockHeader *  header 
)

Definition at line 1438 of file bitcoinkernel.cpp.

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

◆ btck_coin_confirmation_height()

uint32_t btck_coin_confirmation_height ( const btck_Coin *  coin)

Returns the block height where the transaction that created this coin was included in.

Parameters
[in]coinNon-null.
Returns
The block height of the coin.

Definition at line 1405 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_coin_copy()

btck_Coin * btck_coin_copy ( const btck_Coin *  coin)

Copy a coin.

Parameters
[in]coinNon-null.
Returns
The copied coin.

Definition at line 1400 of file bitcoinkernel.cpp.

◆ btck_coin_destroy()

void btck_coin_destroy ( btck_Coin *  coin)

Destroy the coin.

Definition at line 1420 of file bitcoinkernel.cpp.

◆ btck_coin_get_output()

const btck_TransactionOutput * btck_coin_get_output ( const btck_Coin *  coin)

Return the transaction output of a coin.

The returned pointer is unowned and only valid for the lifetime of the coin.

Parameters
[in]coinNon-null.
Returns
A transaction output pointer.

Definition at line 1415 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_coin_is_coinbase()

int btck_coin_is_coinbase ( const btck_Coin *  coin)

Returns whether the containing transaction was a coinbase.

Parameters
[in]coinNon-null.
Returns
1 if the coin is a coinbase coin, 0 otherwise.

Definition at line 1410 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_context_copy()

btck_Context * btck_context_copy ( const btck_Context *  context)

Copy the context.

Definition at line 966 of file bitcoinkernel.cpp.

◆ btck_context_create()

btck_Context * btck_context_create ( const btck_ContextOptions *  context_options)

Create a new kernel context.

If the options have not been previously set, their corresponding fields will be initialized to default values; the context will assume mainnet chain parameters and won't attempt to call the kernel notification callbacks.

Parameters
[in]context_optionsNullable, created by btck_context_options_create.
Returns
The allocated context, or null on error.

Definition at line 954 of file bitcoinkernel.cpp.

◆ btck_context_destroy()

void btck_context_destroy ( btck_Context *  context)

Destroy the context.

Definition at line 976 of file bitcoinkernel.cpp.

◆ btck_context_interrupt()

int btck_context_interrupt ( btck_Context *  context)

Interrupt can be used to halt long-running validation functions like when reindexing, importing or processing blocks.

Parameters
[in]contextNon-null.
Returns
0 if the interrupt was successful, non-zero otherwise.

Definition at line 971 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_context_options_create()

btck_ContextOptions * btck_context_options_create ( )

Creates an empty context options.

Definition at line 924 of file bitcoinkernel.cpp.

◆ btck_context_options_destroy()

void btck_context_options_destroy ( btck_ContextOptions *  options)

Destroy the context options.

Definition at line 949 of file bitcoinkernel.cpp.

◆ btck_context_options_set_chainparams()

void btck_context_options_set_chainparams ( btck_ContextOptions *  options,
const btck_ChainParameters *  chain_parameters 
)

Definition at line 929 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_context_options_set_notifications()

void btck_context_options_set_notifications ( btck_ContextOptions *  context_options,
btck_NotificationInterfaceCallbacks  notifications 
)

Set the kernel notifications for the context options.

The context created with the options will be configured with these notifications.

Parameters
[in]context_optionsNon-null, previously created by btck_context_options_create.
[in]notificationsIs set to the context options.

Definition at line 936 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_context_options_set_validation_interface()

void btck_context_options_set_validation_interface ( btck_ContextOptions *  context_options,
btck_ValidationInterfaceCallbacks  validation_interface_callbacks 
)

Set the validation interface callbacks for the context options.

The context created with the options will be configured for these validation interface callbacks. The callbacks will then be triggered from validation events issued by the chainstate manager created from the same context.

Parameters
[in]context_optionsNon-null, previously created with btck_context_options_create.
[in]validation_interface_callbacksThe callbacks used for passing validation information to the user.

Definition at line 943 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_logging_connection_create()

btck_LoggingConnection * btck_logging_connection_create ( btck_LogCallback  log_callback,
void *  user_data,
btck_DestroyCallback  user_data_destroy_callback 
)

Start logging messages through the provided callback.

Log messages produced before this function is first called are buffered and on calling this function are logged immediately.

Parameters
[in]log_callbackNon-null, function through which messages will be logged.
[in]user_dataNullable, holds a user-defined opaque structure. Is passed back to the user through the callback. If the user_data_destroy_callback is also defined it is assumed that ownership of the user_data is passed to the created logging connection.
[in]user_data_destroy_callbackNullable, function for freeing the user data.
Returns
A new kernel logging connection, or null on error.

Definition at line 863 of file bitcoinkernel.cpp.

◆ btck_logging_connection_destroy()

void btck_logging_connection_destroy ( btck_LoggingConnection *  connection)

Stop logging and destroy the logging connection.

Definition at line 872 of file bitcoinkernel.cpp.

◆ btck_logging_disable()

void btck_logging_disable ( )

This disables the global internal logger.

No log messages will be buffered internally anymore once this is called and the buffer is cleared. This function should only be called once and is not thread or re-entry safe. Log messages will be buffered until this function is called, or a logging connection is created. This must not be called while a logging connection already exists.

Definition at line 858 of file bitcoinkernel.cpp.

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

◆ btck_logging_disable_category()

void btck_logging_disable_category ( btck_LogCategory  category)

Disable a specific log category for the global internal logger.

This changes a global setting and will override settings for all existing btck_LoggingConnection instances.

Parameters
[in]categoryIf btck_LogCategory_ALL is chosen, all categories will be disabled.

Definition at line 853 of file bitcoinkernel.cpp.

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

◆ btck_logging_enable_category()

void btck_logging_enable_category ( btck_LogCategory  category)

Enable a specific log category for the global internal logger.

This changes a global setting and will override settings for all existing btck_LoggingConnection instances.

Parameters
[in]categoryIf btck_LogCategory_ALL is chosen, all categories will be enabled.

Definition at line 848 of file bitcoinkernel.cpp.

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

◆ btck_logging_set_level_category()

void btck_logging_set_level_category ( btck_LogCategory  category,
btck_LogLevel  level 
)

Set the log level of the global internal logger.

This does not enable the selected categories. Use btck_logging_enable_category to start logging from a specific, or all categories. This changes a global setting and will override settings for all existing btck_LoggingConnection instances.

Parameters
[in]categoryIf btck_LogCategory_ALL is chosen, sets both the global fallback log level used by all categories that don't have a specific level set, and also sets the log level for messages logged with the btck_LogCategory_ALL category itself. For any other category, sets a category-specific log level that overrides the global fallback for that category only.
[in]levelLog level at which the log category is set.

Definition at line 838 of file bitcoinkernel.cpp.

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

◆ btck_logging_set_options()

void btck_logging_set_options ( btck_LoggingOptions  options)

Set some options for the global internal logger.

This changes global settings and will override settings for all existing btck_LoggingConnection instances.

Parameters
[in]optionsSets formatting options of the log messages.

Definition at line 828 of file bitcoinkernel.cpp.

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

◆ btck_precomputed_transaction_data_copy()

btck_PrecomputedTransactionData * btck_precomputed_transaction_data_copy ( const btck_PrecomputedTransactionData *  precomputed_txdata)

Copy precomputed transaction data.

Parameters
[in]precomputed_txdataNon-null.
Returns
The copied precomputed transaction data.

Definition at line 668 of file bitcoinkernel.cpp.

◆ btck_precomputed_transaction_data_create()

btck_PrecomputedTransactionData * btck_precomputed_transaction_data_create ( const btck_Transaction *  tx_to,
const btck_TransactionOutput **  spent_outputs,
size_t  spent_outputs_len 
)

Create precomputed transaction data for script verification.

Parameters
[in]tx_toNon-null.
[in]spent_outputsNullable for non-taproot verification. Points to an array of outputs spent by the transaction.
[in]spent_outputs_lenLength of the spent_outputs array.
Returns
The precomputed data, or null on error.

Definition at line 642 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_precomputed_transaction_data_destroy()

void btck_precomputed_transaction_data_destroy ( btck_PrecomputedTransactionData *  precomputed_txdata)

Destroy the precomputed transaction data.

Definition at line 673 of file bitcoinkernel.cpp.

◆ btck_script_pubkey_copy()

btck_ScriptPubkey * btck_script_pubkey_copy ( const btck_ScriptPubkey *  script_pubkey)

Copy a script pubkey.

Parameters
[in]script_pubkeyNon-null.
Returns
The copied script pubkey.

Definition at line 607 of file bitcoinkernel.cpp.

◆ btck_script_pubkey_create()

btck_ScriptPubkey * btck_script_pubkey_create ( const void *  script_pubkey,
size_t  script_pubkey_len 
)

Create a script pubkey from serialized data.

Parameters
[in]script_pubkeySerialized script pubkey.
[in]script_pubkey_lenLength of the script pubkey data.
Returns
The script pubkey.

Definition at line 594 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_script_pubkey_destroy()

void btck_script_pubkey_destroy ( btck_ScriptPubkey *  script_pubkey)

Destroy the script pubkey.

Definition at line 612 of file bitcoinkernel.cpp.

◆ btck_script_pubkey_to_bytes()

int btck_script_pubkey_to_bytes ( const btck_ScriptPubkey *  script_pubkey_,
btck_WriteBytes  writer,
void *  user_data 
)

Definition at line 601 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_script_pubkey_verify()

int btck_script_pubkey_verify ( const btck_ScriptPubkey *  script_pubkey,
const int64_t  amount,
const btck_Transaction *  tx_to,
const btck_PrecomputedTransactionData *  precomputed_txdata,
const unsigned int  input_index,
const btck_ScriptVerificationFlags  flags,
btck_ScriptVerifyStatus *  status 
)

Definition at line 678 of file bitcoinkernel.cpp.

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

◆ btck_set_mock_time()

int btck_set_mock_time ( int64_t  timestamp)

Override the current time with a fixed timestamp for testing.

Affects all kernel time reads globally. The caller is responsible for gating usage (e.g. restricting to regtest) if desired.

The upper bound (4294967295) matches the maximum value of a block header timestamp.

Parameters
[in]timestampUnix epoch seconds, or 0 to restore the system clock.
Returns
0 on success, non-zero if timestamp is outside the valid [0, 4294967295] range.

Definition at line 1595 of file bitcoinkernel.cpp.

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

◆ btck_transaction_check()

int btck_transaction_check ( const btck_Transaction *  tx,
btck_TxValidationState *  validation_state 
)

Definition at line 1587 of file bitcoinkernel.cpp.

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

◆ btck_transaction_copy()

btck_Transaction * btck_transaction_copy ( const btck_Transaction *  transaction)

Copy a transaction.

Transactions are reference counted, so this just increments the reference count.

Parameters
[in]transactionNon-null.
Returns
The copied transaction.

Definition at line 573 of file bitcoinkernel.cpp.

◆ btck_transaction_count_inputs()

size_t btck_transaction_count_inputs ( const btck_Transaction *  transaction)

Get the number of inputs of a transaction.

Parameters
[in]transactionNon-null.
Returns
The number of inputs.

Definition at line 537 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_count_outputs()

size_t btck_transaction_count_outputs ( const btck_Transaction *  transaction)

Get the number of outputs of a transaction.

Parameters
[in]transactionNon-null.
Returns
The number of outputs.

Definition at line 525 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_create()

btck_Transaction * btck_transaction_create ( const void *  raw_transaction,
size_t  raw_transaction_len 
)

Create a new transaction from the serialized data.

Parameters
[in]raw_transactionSerialized transaction.
[in]raw_transaction_lenLength of the serialized transaction.
Returns
The transaction, or null on error.

Definition at line 514 of file bitcoinkernel.cpp.

Here is the call graph for this function:

◆ btck_transaction_destroy()

void btck_transaction_destroy ( btck_Transaction *  transaction)

Destroy the transaction.

Definition at line 589 of file bitcoinkernel.cpp.

◆ btck_transaction_get_input_at()

const btck_TransactionInput * btck_transaction_get_input_at ( const btck_Transaction *  transaction,
size_t  input_index 
)

Get the transaction input at the provided index.

The returned transaction input is not owned and depends on the lifetime of the transaction.

Parameters
[in]transactionNon-null.
[in]input_indexThe index of the transaction input to be retrieved.
Returns
The transaction input

Definition at line 542 of file bitcoinkernel.cpp.

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

◆ btck_transaction_get_locktime()

uint32_t btck_transaction_get_locktime ( const btck_Transaction *  transaction)

Get a transaction's nLockTime value.

Parameters
[in]transactionNon-null.
Returns
The nLockTime value.

Definition at line 553 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_get_output_at()

const btck_TransactionOutput * btck_transaction_get_output_at ( const btck_Transaction *  transaction,
size_t  output_index 
)

Get the transaction outputs at the provided index.

The returned transaction output is not owned and depends on the lifetime of the transaction.

Parameters
[in]transactionNon-null.
[in]output_indexThe index of the transaction output to be retrieved.
Returns
The transaction output

Definition at line 530 of file bitcoinkernel.cpp.

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

◆ btck_transaction_get_txid()

const btck_Txid * btck_transaction_get_txid ( const btck_Transaction *  transaction)

Get the txid of a transaction.

The returned txid is not owned and depends on the lifetime of the transaction.

Parameters
[in]transactionNon-null.
Returns
The txid.

Definition at line 558 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_get_version()

uint32_t btck_transaction_get_version ( const btck_Transaction *  transaction)

Get a transaction's version.

Parameters
[in]transactionNon-null.
Returns
The version.

Definition at line 548 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_get_wtxid()

const btck_Wtxid * btck_transaction_get_wtxid ( const btck_Transaction *  transaction)

Get the wtxid of a transaction.

The returned wtxid is not owned and depends on the lifetime of the transaction.

Parameters
[in]transactionNon-null.
Returns
The wtxid.

Definition at line 568 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_has_witness()

int btck_transaction_has_witness ( const btck_Transaction *  transaction)

Check whether a transaction has witness data.

Parameters
[in]transactionNon-null.
Returns
1 if the transaction has witness data, 0 if not.

Definition at line 563 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_input_copy()

btck_TransactionInput * btck_transaction_input_copy ( const btck_TransactionInput *  transaction_input)

Copy a transaction input.

Parameters
[in]transaction_inputNon-null.
Returns
The copied transaction input.

Definition at line 715 of file bitcoinkernel.cpp.

◆ btck_transaction_input_destroy()

void btck_transaction_input_destroy ( btck_TransactionInput *  input)

Destroy the transaction input.

Definition at line 741 of file bitcoinkernel.cpp.

◆ btck_transaction_input_get_out_point()

const btck_TransactionOutPoint * btck_transaction_input_get_out_point ( const btck_TransactionInput *  transaction_input)

Get the transaction out point.

The returned transaction out point is not owned and depends on the lifetime of the transaction.

Parameters
[in]transaction_inputNon-null.
Returns
The transaction out point.

Definition at line 720 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_input_get_script_sig()

int btck_transaction_input_get_script_sig ( const btck_TransactionInput *  input,
btck_WriteBytes  writer,
void *  user_data 
)

Definition at line 735 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_input_get_sequence()

uint32_t btck_transaction_input_get_sequence ( const btck_TransactionInput *  transaction_input)

Get a transaction input's nSequence value.

Parameters
[in]transaction_inputNon-null.
Returns
The nSequence value.

Definition at line 725 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_input_get_witness_stack()

const btck_WitnessStack * btck_transaction_input_get_witness_stack ( const btck_TransactionInput *  transaction_input)

Get the witness stack of a transaction input.

The returned witness stack is not owned and depends on the lifetime of the transaction input.

Parameters
[in]transaction_inputNon-null.
Returns
The witness stack.

Definition at line 730 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_out_point_copy()

btck_TransactionOutPoint * btck_transaction_out_point_copy ( const btck_TransactionOutPoint *  transaction_out_point)

Copy a transaction out point.

Parameters
[in]transaction_out_pointNon-null.
Returns
The copied transaction out point.

Definition at line 768 of file bitcoinkernel.cpp.

◆ btck_transaction_out_point_destroy()

void btck_transaction_out_point_destroy ( btck_TransactionOutPoint *  out_point)

Destroy the transaction out point.

Definition at line 783 of file bitcoinkernel.cpp.

◆ btck_transaction_out_point_get_index()

uint32_t btck_transaction_out_point_get_index ( const btck_TransactionOutPoint *  transaction_out_point)

Get the output position from the transaction out point.

Parameters
[in]transaction_out_pointNon-null.
Returns
The output index.

Definition at line 773 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_out_point_get_txid()

const btck_Txid * btck_transaction_out_point_get_txid ( const btck_TransactionOutPoint *  transaction_out_point)

Get the txid from the transaction out point.

The returned txid is not owned and depends on the lifetime of the transaction out point.

Parameters
[in]transaction_out_pointNon-null.
Returns
The txid.

Definition at line 778 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_output_copy()

btck_TransactionOutput * btck_transaction_output_copy ( const btck_TransactionOutput *  transaction_output)

Copy a transaction output.

Parameters
[in]transaction_outputNon-null.
Returns
The copied transaction output.

Definition at line 622 of file bitcoinkernel.cpp.

◆ btck_transaction_output_create()

btck_TransactionOutput * btck_transaction_output_create ( const btck_ScriptPubkey *  script_pubkey,
int64_t  amount 
)

Create a transaction output from a script pubkey and an amount.

Parameters
[in]script_pubkeyNon-null.
[in]amountThe amount associated with the script pubkey for this output.
Returns
The transaction output.

Definition at line 617 of file bitcoinkernel.cpp.

◆ btck_transaction_output_destroy()

void btck_transaction_output_destroy ( btck_TransactionOutput *  output)

Destroy the transaction output.

Definition at line 637 of file bitcoinkernel.cpp.

◆ btck_transaction_output_get_amount()

int64_t btck_transaction_output_get_amount ( const btck_TransactionOutput *  transaction_output)

Get the amount in the output.

Parameters
[in]transaction_outputNon-null.
Returns
The amount.

Definition at line 632 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_output_get_script_pubkey()

const btck_ScriptPubkey * btck_transaction_output_get_script_pubkey ( const btck_TransactionOutput *  transaction_output)

Get the script pubkey of the output.

The returned script pubkey is not owned and depends on the lifetime of the transaction output.

Parameters
[in]transaction_outputNon-null.
Returns
The script pubkey.

Definition at line 627 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_spent_outputs_copy()

btck_TransactionSpentOutputs * btck_transaction_spent_outputs_copy ( const btck_TransactionSpentOutputs *  transaction_spent_outputs)

Copy a transaction's spent outputs.

Parameters
[in]transaction_spent_outputsNon-null.
Returns
The copied transaction spent outputs.

Definition at line 1378 of file bitcoinkernel.cpp.

◆ btck_transaction_spent_outputs_count()

size_t btck_transaction_spent_outputs_count ( const btck_TransactionSpentOutputs *  transaction_spent_outputs)

Returns the number of previous transaction outputs contained in the transaction spent outputs data.

Parameters
[in]transaction_spent_outputsNon-null
Returns
The number of spent transaction outputs for the transaction.

Definition at line 1383 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_transaction_spent_outputs_destroy()

void btck_transaction_spent_outputs_destroy ( btck_TransactionSpentOutputs *  transaction_spent_outputs)

Destroy the transaction spent outputs.

Definition at line 1388 of file bitcoinkernel.cpp.

◆ btck_transaction_spent_outputs_get_coin_at()

const btck_Coin * btck_transaction_spent_outputs_get_coin_at ( const btck_TransactionSpentOutputs *  transaction_spent_outputs,
size_t  coin_index 
)

Returns a coin contained in the transaction spent outputs at a certain index.

The returned pointer is unowned and only valid for the lifetime of transaction_spent_outputs.

Parameters
[in]transaction_spent_outputsNon-null.
[in]coin_indexThe index of the to be retrieved coin within the transaction spent outputs.
Returns
A coin pointer.

Definition at line 1393 of file bitcoinkernel.cpp.

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

◆ btck_transaction_to_bytes()

int btck_transaction_to_bytes ( const btck_Transaction *  transaction,
btck_WriteBytes  writer,
void *  user_data 
)

Definition at line 578 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_tx_validation_state_create()

btck_TxValidationState * btck_tx_validation_state_create ( )

Create a new btck_TxValidationState.

Definition at line 1557 of file bitcoinkernel.cpp.

◆ btck_tx_validation_state_destroy()

void btck_tx_validation_state_destroy ( btck_TxValidationState *  state)

Destroy the btck_TxValidationState.

Definition at line 1582 of file bitcoinkernel.cpp.

◆ btck_tx_validation_state_get_tx_validation_result()

btck_TxValidationResult btck_tx_validation_state_get_tx_validation_result ( const btck_TxValidationState *  state)

Returns the validation result from an opaque btck_TxValidationState pointer.

btck_transaction_check currently produces only btck_TxValidationResult_UNSET for valid transactions and btck_TxValidationResult_CONSENSUS for invalid ones. Other values remain exposed for forward compatibility with higher-level validation entry points.

Definition at line 1562 of file bitcoinkernel.cpp.

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

◆ btck_tx_validation_state_get_validation_mode()

btck_ValidationMode btck_tx_validation_state_get_validation_mode ( const btck_TxValidationState *  state_)

Returns the validation mode from an opaque btck_TxValidationState pointer.

Definition at line 1549 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_txid_copy()

btck_Txid * btck_txid_copy ( const btck_Txid *  txid)

Copy a txid.

Parameters
[in]txidNon-null.
Returns
The copied txid.

Definition at line 788 of file bitcoinkernel.cpp.

◆ btck_txid_destroy()

void btck_txid_destroy ( btck_Txid *  txid)

Destroy the txid.

Definition at line 803 of file bitcoinkernel.cpp.

◆ btck_txid_equals()

int btck_txid_equals ( const btck_Txid *  txid1,
const btck_Txid *  txid2 
)

Definition at line 798 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_txid_to_bytes()

void btck_txid_to_bytes ( const btck_Txid *  txid,
unsigned char  output[32] 
)

Definition at line 793 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_witness_stack_copy()

btck_WitnessStack * btck_witness_stack_copy ( const btck_WitnessStack *  witness_stack)

Copy a witness stack.

Parameters
[in]witness_stackNon-null.
Returns
The copied witness stack.

Definition at line 758 of file bitcoinkernel.cpp.

◆ btck_witness_stack_count_items()

size_t btck_witness_stack_count_items ( const btck_WitnessStack *  witness_stack)

Return the number of items in a witness stack.

Parameters
[in]witness_stackNon-null.
Returns
The number of witness stack items.

Definition at line 746 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_witness_stack_destroy()

void btck_witness_stack_destroy ( btck_WitnessStack *  witness_stack)

Destroy the witness stack.

Definition at line 763 of file bitcoinkernel.cpp.

◆ btck_witness_stack_get_item_at()

int btck_witness_stack_get_item_at ( const btck_WitnessStack *  witness_stack,
size_t  index,
btck_WriteBytes  writer,
void *  user_data 
)

Definition at line 751 of file bitcoinkernel.cpp.

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

◆ btck_wtxid_copy()

btck_Wtxid * btck_wtxid_copy ( const btck_Wtxid *  wtxid)

Copy a wtxid.

Parameters
[in]wtxidNon-null.
Returns
The copied wtxid.

Definition at line 808 of file bitcoinkernel.cpp.

◆ btck_wtxid_destroy()

void btck_wtxid_destroy ( btck_Wtxid *  wtxid)

Destroy the wtxid.

Definition at line 823 of file bitcoinkernel.cpp.

◆ btck_wtxid_equals()

int btck_wtxid_equals ( const btck_Wtxid *  wtxid1,
const btck_Wtxid *  wtxid2 
)

Definition at line 818 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_wtxid_to_bytes()

void btck_wtxid_to_bytes ( const btck_Wtxid *  wtxid,
unsigned char  output[32] 
)

Definition at line 813 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

Variable Documentation

◆ btck_context_static

const kernel::Context btck_context_static {}
static

Definition at line 69 of file bitcoinkernel.cpp.

◆ G_TRANSLATION_FUN

const TranslateFn G_TRANSLATION_FUN {nullptr}
extern

Definition at line 61 of file bitcoin-cli.cpp.