A struct for holding the kernel notification callbacks. The user data
pointer may be used to point to user-defined structures to make processing
the notifications easier. Note that this makes it the user’s responsibility
to ensure that the user_data outlives the kernel objects. Notifications can
occur even as kernel objects are deleted, so care has to be taken to ensure
safe unwinding.
Holds the validation interface callbacks. The user data pointer may be used
to point to user-defined structures to make processing the validation
callbacks easier. Note that these callbacks block any further validation
execution when they are called.
@brief 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.
@brief 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.
@brief 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.
@brief Returns the best known currently active chain. Its lifetime is
dependent on the chainstate manager and state transitions within the
chainstate manager, e.g. when processing blocks, will also change the chain.
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.
@brief Triggers the start of a reindex if the option was previously set for
the chainstate and block manager. Can also import an array of existing block
files selected by the user.
@brief Sets wipe db in the options. In combination with calling
@ref btck_chainstate_manager_import_blocks this triggers either a full reindex,
or a reindex of just the chainstate database.
@brief Process and validate the passed in block with the chainstate
manager. More detailed validation information in case of a failure can also
be retrieved through a registered validation interface. If the block fails
to validate the block_checked callback’s ‘BlockValidationState’ will
contain details.
@brief 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.
@brief 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.
@brief 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.
@brief 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.
@brief Disable a specific log category for the global internal logger. This
changes a global setting and will override settings for all existing @ref
btck_LoggingConnection instances.
@brief Enable a specific log category for the global internal logger. This
changes a global setting and will override settings for all existing @ref
btck_LoggingConnection instances.
@brief Set the log level of the global internal logger. This does not
enable the selected categories. Use @ref 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
@ref btck_LoggingConnection instances.
@brief Create a script pubkey from serialized data.
@param[in] script_pubkey Non-null.
@param[in] script_pubkey_len Length of the script pubkey data.
@return The script pubkey.
@brief Verify if the input at input_index of tx_to spends the script pubkey
under the constraints specified by flags. If the
btck_SCRIPT_FLAGS_VERIFY_WITNESS flag is set in the flags bitfield, the
amount parameter is used. If the taproot flag is set, the spent outputs
parameter is used to validate taproot transactions.
@brief 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.