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 Return the next block index in the currently active chain, or null if
the current block index is the tip, or is not in the currently active
chain.
@brief Return a transaction output contained in the transaction undo data
of a block undo data at a certain index. This value is copied from the
underlying data and thus owned entirely by the user.
@brief Returns the block height of the block that contains the output at
output_index within the transaction undo data at the provided index of the
block undo data.
@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. It is only valid for as long as
the passed in context also remains in memory.
@brief May be called once the kernel_ChainstateManager is instantiated.
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 kernel_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
function is not thread safe. Mutiple calls from different threads are
allowed but must be synchronized. This changes a global setting and will
override settings for all existing @ref kernel_LoggingConnection instances.
@brief Enable a specific log category for the global internal logger. This
function is not thread safe. Mutiple calls from different threads are
allowed but must be synchronized. This changes a global setting and will
override settings for all existing @ref kernel_LoggingConnection instances.
@brief Set the log level of the global internal logger. This does not
enable the selected categories. Use @ref kernel_logging_enable_category to
start logging from a specific, or all categories. This function is not
thread safe. Mutiple calls from different threads are allowed but must be
synchronized. This changes a global setting and will override settings for
all existing @ref kernel_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 Create a transaction output from a script pubkey and an amount.
@param[in] script_pubkey Non-null.
@param[in] amount The amount associated with the script pubkey for this output.
@return The transaction output.
@brief Verify if the input at input_index of tx_to spends the script pubkey
under the constraints specified by flags. If the
kernel_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.