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.
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. 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.
@brief 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.
@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. Processing first does checks on the block, and if these passed,
saves it to disk. It then validates the block against the utxo set. If it is
valid, the chain is extended with it. The return value is not indicative of
the block’s validity. Detailed information on the validity of the block can
be retrieved by registering the block_checked callback in the validation
interface.
@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. This must not be called while a logging connection
already exists.
@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 Set some options for the global internal logger. This changes global
settings and will override settings for all existing @ref
btck_LoggingConnection instances.
@brief Create a script pubkey from serialized data.
@param[in] script_pubkey Serialized script pubkey.
@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_ScriptVerificationFlags_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.