Bitcoin Core 30.99.0
P2P Digital Currency
Classes | Macros | Functions | Variables
bitcoinkernel.cpp File Reference
#include <kernel/bitcoinkernel.h>
#include <chain.h>
#include <coins.h>
#include <consensus/amount.h>
#include <consensus/validation.h>
#include <kernel/caches.h>
#include <kernel/chainparams.h>
#include <kernel/checks.h>
#include <kernel/context.h>
#include <kernel/cs_main.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 <serialize.h>
#include <streams.h>
#include <sync.h>
#include <tinyformat.h>
#include <uint256.h>
#include <undo.h>
#include <util/fs.h>
#include <util/result.h>
#include <util/signalinterrupt.h>
#include <util/task_runner.h>
#include <util/translation.h>
#include <validation.h>
#include <validationinterface.h>
#include <cassert>
#include <cstddef>
#include <cstring>
#include <exception>
#include <functional>
#include <list>
#include <memory>
#include <span>
#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_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_TransactionOutPoint
 
struct  btck_Txid
 

Macros

#define BITCOINKERNEL_BUILD
 

Functions

btck_Transactionbtck_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_TransactionOutputbtck_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_TransactionInputbtck_transaction_get_input_at (const btck_Transaction *transaction, size_t input_index)
 Get the transaction input at the provided index. More...
 
const btck_Txidbtck_transaction_get_txid (const btck_Transaction *transaction)
 Get the txid of a transaction. More...
 
btck_Transactionbtck_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_ScriptPubkeybtck_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_ScriptPubkeybtck_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_TransactionOutputbtck_transaction_output_create (const btck_ScriptPubkey *script_pubkey, int64_t amount)
 Create a transaction output from a script pubkey and an amount. More...
 
btck_TransactionOutputbtck_transaction_output_copy (const btck_TransactionOutput *output)
 Copy a transaction output. More...
 
const btck_ScriptPubkeybtck_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...
 
int btck_script_pubkey_verify (const btck_ScriptPubkey *script_pubkey, const int64_t amount, const btck_Transaction *tx_to, const btck_TransactionOutput **spent_outputs_, size_t spent_outputs_len, const unsigned int input_index, const btck_ScriptVerificationFlags flags, btck_ScriptVerifyStatus *status)
 
btck_TransactionInputbtck_transaction_input_copy (const btck_TransactionInput *input)
 Copy a transaction input. More...
 
const btck_TransactionOutPointbtck_transaction_input_get_out_point (const btck_TransactionInput *input)
 Get the transaction out point. More...
 
void btck_transaction_input_destroy (btck_TransactionInput *input)
 Destroy the transaction input. More...
 
btck_TransactionOutPointbtck_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_Txidbtck_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_Txidbtck_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...
 
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_LoggingConnectionbtck_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_ChainParametersbtck_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_ChainParametersbtck_chain_parameters_copy (const btck_ChainParameters *chain_parameters)
 Copy the chain parameters. More...
 
void btck_chain_parameters_destroy (btck_ChainParameters *chain_parameters)
 Destroy the chain parameters. More...
 
btck_ContextOptionsbtck_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_Contextbtck_context_create (const btck_ContextOptions *options)
 Create a new kernel context. More...
 
btck_Contextbtck_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_BlockTreeEntrybtck_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...
 
btck_ValidationMode btck_block_validation_state_get_validation_mode (const btck_BlockValidationState *block_validation_state_)
 Returns the validation mode from an opaque block validation state 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 block validation state pointer. More...
 
btck_ChainstateManagerOptionsbtck_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)
 
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...
 
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_ChainstateManagerbtck_chainstate_manager_create (const btck_ChainstateManagerOptions *chainman_opts)
 Create a chainstate manager. More...
 
const btck_BlockTreeEntrybtck_chainstate_manager_get_block_tree_entry_by_hash (const btck_ChainstateManager *chainman, const btck_BlockHash *block_hash)
 
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_Blockbtck_block_create (const void *raw_block, size_t raw_block_length)
 Parse a serialized raw block into a new block object. More...
 
btck_Blockbtck_block_copy (const btck_Block *block)
 Copy a block. More...
 
size_t btck_block_count_transactions (const btck_Block *block)
 Count the number of transactions contained in a block. More...
 
const btck_Transactionbtck_block_get_transaction_at (const btck_Block *block, size_t index)
 Get the transaction at the provided index. More...
 
int btck_block_to_bytes (const btck_Block *block, btck_WriteBytes writer, void *user_data)
 
btck_BlockHashbtck_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_Blockbtck_block_read (const btck_ChainstateManager *chainman, const btck_BlockTreeEntry *entry)
 
int32_t btck_block_tree_entry_get_height (const btck_BlockTreeEntry *entry)
 Return the height of a certain block tree entry. More...
 
const btck_BlockHashbtck_block_tree_entry_get_block_hash (const btck_BlockTreeEntry *entry)
 Return the block hash associated with a block tree entry. More...
 
btck_BlockHashbtck_block_hash_create (const unsigned char block_hash[32])
 Create a block hash from its raw data. More...
 
btck_BlockHashbtck_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_BlockSpentOutputsbtck_block_spent_outputs_read (const btck_ChainstateManager *chainman, const btck_BlockTreeEntry *entry)
 
btck_BlockSpentOutputsbtck_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_TransactionSpentOutputsbtck_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_TransactionSpentOutputsbtck_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_Coinbtck_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_Coinbtck_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_TransactionOutputbtck_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)
 
const btck_Chainbtck_chainstate_manager_get_active_chain (const btck_ChainstateManager *chainman)
 Returns the best known currently active chain. More...
 
const btck_BlockTreeEntrybtck_chain_get_tip (const btck_Chain *chain)
 Get the block tree entry of the current chain tip. More...
 
int btck_chain_get_height (const btck_Chain *chain)
 Return the height of the tip of the chain. More...
 
const btck_BlockTreeEntrybtck_chain_get_genesis (const btck_Chain *chain)
 Get the block tree entry of the genesis block. More...
 
const btck_BlockTreeEntrybtck_chain_get_by_height (const btck_Chain *chain, int 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)
 

Variables

const std::function< std::string(const char *)> 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_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 1050 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 1055 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_blockNon-null, serialized block.
[in]raw_block_lenLength of the serialized block.
Returns
The allocated block, or null on error.

Definition at line 1034 of file bitcoinkernel.cpp.

◆ btck_block_destroy()

void btck_block_destroy ( btck_Block block)

Destroy the block.

Definition at line 1082 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 1077 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 1060 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 1112 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 1107 of file bitcoinkernel.cpp.

◆ btck_block_hash_destroy()

void btck_block_hash_destroy ( btck_BlockHash hash)

Destroy the block hash.

Definition at line 1127 of file bitcoinkernel.cpp.

◆ btck_block_hash_equals()

int btck_block_hash_equals ( const btck_BlockHash hash1,
const btck_BlockHash hash2 
)

Definition at line 1122 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 1117 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 1087 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 1146 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 1151 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 1163 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 1156 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 1132 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 1066 of file bitcoinkernel.cpp.

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 1102 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 1097 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 847 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ 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 block validation state pointer.

Definition at line 865 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 block validation state pointer.

Definition at line 857 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 1257 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,
int  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 1251 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chain_get_genesis()

const btck_BlockTreeEntry * btck_chain_get_genesis ( const btck_Chain chain)

Get the block tree entry of the genesis block.

Parameters
[in]chainNon-null.
Returns
The block tree entry of the genesis block, or null if the chain is empty.

Definition at line 1245 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chain_get_height()

int 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 1239 of file bitcoinkernel.cpp.

Here is the caller graph for this function:

◆ btck_chain_get_tip()

const btck_BlockTreeEntry * btck_chain_get_tip ( const btck_Chain chain)

Get the block tree entry of the current chain tip.

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

Parameters
[in]chainNon-null.
Returns
The block tree entry of the current tip, or null if the chain is empty.

Definition at line 1233 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 780 of file bitcoinkernel.cpp.

◆ btck_chain_parameters_create()

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.

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

Definition at line 758 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 785 of file bitcoinkernel.cpp.

◆ 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 947 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 1001 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 1228 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 990 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 1016 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_dir,
size_t  data_dir_len,
const char *  blocks_dir,
size_t  blocks_dir_len 
)

Definition at line 891 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 911 of file bitcoinkernel.cpp.

◆ 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.

Definition at line 916 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 905 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 929 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 938 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 1215 of file bitcoinkernel.cpp.

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 1195 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 1190 of file bitcoinkernel.cpp.

◆ btck_coin_destroy()

void btck_coin_destroy ( btck_Coin coin)

Destroy the coin.

Definition at line 1210 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 1205 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 1200 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 832 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 820 of file bitcoinkernel.cpp.

◆ btck_context_destroy()

void btck_context_destroy ( btck_Context context)

Destroy the context.

Definition at line 842 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 837 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 790 of file bitcoinkernel.cpp.

◆ btck_context_options_destroy()

void btck_context_options_destroy ( btck_ContextOptions options)

Destroy the context options.

Definition at line 815 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 795 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 802 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 809 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 744 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 753 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 739 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 734 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 729 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 719 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 ( const 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 709 of file bitcoinkernel.cpp.

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

◆ 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 569 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_pubkeyNon-null.
[in]script_pubkey_lenLength of the script pubkey data.
Returns
The script pubkey.

Definition at line 557 of file bitcoinkernel.cpp.

◆ btck_script_pubkey_destroy()

void btck_script_pubkey_destroy ( btck_ScriptPubkey script_pubkey)

Destroy the script pubkey.

Definition at line 574 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 563 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_TransactionOutput **  spent_outputs_,
size_t  spent_outputs_len,
const unsigned int  input_index,
const btck_ScriptVerificationFlags  flags,
btck_ScriptVerifyStatus status 
)

Definition at line 604 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 536 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 520 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 508 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_transactionNon-null.
[in]raw_transaction_lenLength of the serialized transaction.
Returns
The transaction, or null on error.

Definition at line 498 of file bitcoinkernel.cpp.

◆ btck_transaction_destroy()

void btck_transaction_destroy ( btck_Transaction transaction)

Destroy the transaction.

Definition at line 552 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 525 of file bitcoinkernel.cpp.

Here is the call graph for this function:
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 513 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 531 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 654 of file bitcoinkernel.cpp.

◆ btck_transaction_input_destroy()

void btck_transaction_input_destroy ( btck_TransactionInput input)

Destroy the transaction input.

Definition at line 664 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 659 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 669 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 684 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 674 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 679 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 584 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 579 of file bitcoinkernel.cpp.

◆ btck_transaction_output_destroy()

void btck_transaction_output_destroy ( btck_TransactionOutput output)

Destroy the transaction output.

Definition at line 599 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 594 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 589 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 1168 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 1173 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 1178 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 1183 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 541 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 689 of file bitcoinkernel.cpp.

◆ btck_txid_destroy()

void btck_txid_destroy ( btck_Txid txid)

Destroy the txid.

Definition at line 704 of file bitcoinkernel.cpp.

◆ btck_txid_equals()

int btck_txid_equals ( const btck_Txid txid1,
const btck_Txid txid2 
)

Definition at line 699 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 694 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 60 of file bitcoinkernel.cpp.

◆ G_TRANSLATION_FUN

const std::function<std::string(const char*)> G_TRANSLATION_FUN {nullptr}
extern

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