Crate libbitcoinkernel_sys

Source

Structs§

__fsid_t
kernel_Block
kernel_BlockHash
A type-safe block identifier.
kernel_BlockIndex
kernel_BlockPointer
kernel_BlockUndo
kernel_BlockValidationState
kernel_ByteArray
Convenience struct for holding serialized data.
kernel_ChainParameters
kernel_ChainstateManager
kernel_ChainstateManagerOptions
kernel_Context
kernel_ContextOptions
kernel_LoggingConnection
kernel_LoggingOptions
Options controlling the format of log messages.
kernel_NotificationInterfaceCallbacks
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.
kernel_ScriptPubkey
kernel_Transaction
kernel_TransactionOutput
kernel_ValidationInterfaceCallbacks
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.
max_align_t

Constants§

INT8_MAX
INT8_MIN
INT16_MAX
INT16_MIN
INT32_MAX
INT32_MIN
INTPTR_MAX
INTPTR_MIN
INT_FAST8_MAX
INT_FAST8_MIN
INT_FAST16_MAX
INT_FAST16_MIN
INT_FAST32_MAX
INT_FAST32_MIN
INT_LEAST8_MAX
INT_LEAST8_MIN
INT_LEAST16_MAX
INT_LEAST16_MIN
INT_LEAST32_MAX
INT_LEAST32_MIN
PTRDIFF_MAX
PTRDIFF_MIN
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIZE_MAX
UINT8_MAX
UINT16_MAX
UINT32_MAX
UINTPTR_MAX
UINT_FAST8_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_LEAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
WINT_MAX
WINT_MIN
_ATFILE_SOURCE
_BITS_STDINT_INTN_H
_BITS_STDINT_LEAST_H
_BITS_STDINT_UINTN_H
_BITS_TIME64_H
_BITS_TYPESIZES_H
_BITS_TYPES_H
_BITS_WCHAR_H
_DEFAULT_SOURCE
_FEATURES_H
_POSIX_C_SOURCE
_POSIX_SOURCE
_STDC_PREDEF_H
_STDINT_H
_SYS_CDEFS_H
__FD_SETSIZE
__GLIBC_MINOR__
__GLIBC_USE_C2X_STRTOL
__GLIBC_USE_DEPRECATED_GETS
__GLIBC_USE_DEPRECATED_SCANF
__GLIBC_USE_IEC_60559_BFP_EXT
__GLIBC_USE_IEC_60559_BFP_EXT_C2X
__GLIBC_USE_IEC_60559_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT
__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X
__GLIBC_USE_IEC_60559_TYPES_EXT
__GLIBC_USE_ISOC2X
__GLIBC_USE_LIB_EXT2
__GLIBC__
__GNU_LIBRARY__
__HAVE_GENERIC_SELECTION
__INO_T_MATCHES_INO64_T
__KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64
__LDOUBLE_REDIRECTS_TO_FLOAT128_ABI
__OFF_T_MATCHES_OFF64_T
__RLIM_T_MATCHES_RLIM64_T
__STATFS_MATCHES_STATFS64
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_IEC_60559_BFP__
__STDC_IEC_60559_COMPLEX__
__STDC_ISO_10646__
__SYSCALL_WORDSIZE
__TIMESIZE
__USE_ATFILE
__USE_FORTIFY_LEVEL
__USE_ISOC11
__USE_ISOC95
__USE_ISOC99
__USE_MISC
__USE_POSIX
__USE_POSIX2
__USE_POSIX199309
__USE_POSIX199506
__USE_POSIX_IMPLICITLY
__USE_XOPEN2K
__USE_XOPEN2K8
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32
__bool_true_false_are_defined
__glibc_c99_flexarr_available
false_
kernel_BlockValidationResult_kernel_BLOCK_CACHED_INVALID
!< this block was cached as being invalid and we didn’t store the reason why
kernel_BlockValidationResult_kernel_BLOCK_CONSENSUS
!< invalid by consensus rules (excluding any below reasons)
kernel_BlockValidationResult_kernel_BLOCK_HEADER_LOW_WORK
!< the block header may be on a too-little-work chain
kernel_BlockValidationResult_kernel_BLOCK_INVALID_HEADER
!< invalid proof of work or time too old
kernel_BlockValidationResult_kernel_BLOCK_INVALID_PREV
!< A block this one builds on is invalid
kernel_BlockValidationResult_kernel_BLOCK_MISSING_PREV
!< We don’t have the previous block the checked one is built on
kernel_BlockValidationResult_kernel_BLOCK_MUTATED
!< the block’s data didn’t match the data committed to by the PoW
kernel_BlockValidationResult_kernel_BLOCK_RESULT_UNSET
!< initial value. Block has not yet been rejected
kernel_BlockValidationResult_kernel_BLOCK_TIME_FUTURE
!< block timestamp was > 2 hours in the future (or our clock is bad)
kernel_ChainType_kernel_CHAIN_TYPE_MAINNET
kernel_ChainType_kernel_CHAIN_TYPE_REGTEST
kernel_ChainType_kernel_CHAIN_TYPE_SIGNET
kernel_ChainType_kernel_CHAIN_TYPE_TESTNET
kernel_ChainType_kernel_CHAIN_TYPE_TESTNET_4
kernel_LogCategory_kernel_LOG_ALL
kernel_LogCategory_kernel_LOG_BENCH
kernel_LogCategory_kernel_LOG_BLOCKSTORAGE
kernel_LogCategory_kernel_LOG_COINDB
kernel_LogCategory_kernel_LOG_KERNEL
kernel_LogCategory_kernel_LOG_LEVELDB
kernel_LogCategory_kernel_LOG_MEMPOOL
kernel_LogCategory_kernel_LOG_PRUNE
kernel_LogCategory_kernel_LOG_RAND
kernel_LogCategory_kernel_LOG_REINDEX
kernel_LogCategory_kernel_LOG_VALIDATION
kernel_LogLevel_kernel_LOG_DEBUG
kernel_LogLevel_kernel_LOG_INFO
kernel_LogLevel_kernel_LOG_TRACE
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_ALL
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY
!< enable CHECKLOCKTIMEVERIFY (BIP65)
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY
!< enable CHECKSEQUENCEVERIFY (BIP112)
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_DERSIG
!< enforce strict DER (BIP66) compliance
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_NONE
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_NULLDUMMY
!< enforce NULLDUMMY (BIP147)
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_P2SH
!< evaluate P2SH (BIP16) subscripts
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_TAPROOT
!< enable TAPROOT (BIPs 341 & 342)
kernel_ScriptFlags_kernel_SCRIPT_FLAGS_VERIFY_WITNESS
!< enable WITNESS (BIP141)
kernel_ScriptVerifyStatus_kernel_SCRIPT_VERIFY_ERROR_INVALID_FLAGS
!< The provided bitfield for the flags was invalid.
kernel_ScriptVerifyStatus_kernel_SCRIPT_VERIFY_ERROR_INVALID_FLAGS_COMBINATION
!< The flags very combined in an invalid way.
kernel_ScriptVerifyStatus_kernel_SCRIPT_VERIFY_ERROR_SPENT_OUTPUTS_MISMATCH
!< The number of spent outputs does not match the number of inputs of the tx.
kernel_ScriptVerifyStatus_kernel_SCRIPT_VERIFY_ERROR_SPENT_OUTPUTS_REQUIRED
!< The taproot flag was set, so valid spent_outputs have to be provided.
kernel_ScriptVerifyStatus_kernel_SCRIPT_VERIFY_ERROR_TX_INPUT_INDEX
!< The provided input index is out of range of the actual number of inputs of the transaction.
kernel_ScriptVerifyStatus_kernel_SCRIPT_VERIFY_OK
kernel_SynchronizationState_kernel_INIT_DOWNLOAD
kernel_SynchronizationState_kernel_INIT_REINDEX
kernel_SynchronizationState_kernel_POST_INIT
kernel_ValidationMode_kernel_VALIDATION_STATE_ERROR
kernel_ValidationMode_kernel_VALIDATION_STATE_INVALID
kernel_ValidationMode_kernel_VALIDATION_STATE_VALID
kernel_Warning_kernel_LARGE_WORK_INVALID_CHAIN
kernel_Warning_kernel_UNKNOWN_NEW_RULES_ACTIVATED
true_

Functions§

kernel_block_copy_data
@brief Copies block data into the returned byte array.
kernel_block_create
@brief Parse a serialized raw block into a new block object.
kernel_block_destroy
Destroy the block.
kernel_block_get_hash
@brief Calculate and return the hash of a block.
kernel_block_hash_destroy
Destroy the block hash.
kernel_block_index_destroy
@brief Destroy the block index.
kernel_block_index_get_block_hash
@brief Return the block hash associated with a block index.
kernel_block_index_get_by_hash
@brief Retrieve a block index by its block hash.
kernel_block_index_get_by_height
@brief Retrieve a block index by its height in the currently active chain. Once retrieved there is no guarantee that it remains in the active chain.
kernel_block_index_get_genesis
@brief Get the block index entry of the genesis block.
kernel_block_index_get_height
@brief Return the height of a certain block index.
kernel_block_index_get_next
@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.
kernel_block_index_get_previous
@brief Returns the previous block index in the chain, or null if the current block index entry is the genesis block.
kernel_block_index_get_tip
@brief Get the block index entry of the current chain tip. Once returned, there is no guarantee that it remains in the active chain.
kernel_block_pointer_copy_data
@brief Copies block data into the returned byte array.
kernel_block_pointer_get_hash
@brief Calculate and return the hash of a block.
kernel_block_read
@brief Reads the block the passed in block index points to from disk and returns it.
kernel_block_undo_copy_transaction_output_by_index
@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.
kernel_block_undo_destroy
Destroy the block undo data.
kernel_block_undo_get_transaction_output_height_by_index
@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.
kernel_block_undo_get_transaction_undo_size
@brief Returns the number of previous transaction outputs contained in the transaction undo data.
kernel_block_undo_read
@brief Reads the block undo data the passed in block index points to from disk and returns it.
kernel_block_undo_size
@brief Returns the number of transactions whose undo data is contained in block undo.
kernel_block_validation_state_get_block_validation_result
Returns the validation result from an opaque block validation state pointer.
kernel_block_validation_state_get_validation_mode
Returns the validation mode from an opaque block validation state pointer.
kernel_byte_array_destroy
A helper function for destroying an existing byte array.
kernel_chain_parameters_create
@brief Creates a chain parameters struct with default parameters based on the passed in chain type.
kernel_chain_parameters_destroy
Destroy the chain parameters.
kernel_chainstate_manager_create
@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.
kernel_chainstate_manager_destroy
Destroy the chainstate manager.
kernel_chainstate_manager_import_blocks
@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.
kernel_chainstate_manager_options_create
@brief Create options for the chainstate manager.
kernel_chainstate_manager_options_destroy
Destroy the chainstate manager options.
kernel_chainstate_manager_options_set_block_tree_db_in_memory
@brief Sets block tree db in memory in the options.
kernel_chainstate_manager_options_set_chainstate_db_in_memory
@brief Sets chainstate db in memory in the options.
kernel_chainstate_manager_options_set_wipe_dbs
@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.
kernel_chainstate_manager_options_set_worker_threads_num
@brief Set the number of available worker threads used during validation.
kernel_chainstate_manager_process_block
@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.
kernel_context_create
@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.
kernel_context_destroy
Destroy the context.
kernel_context_interrupt
@brief Interrupt can be used to halt long-running validation functions like when reindexing, importing or processing blocks.
kernel_context_options_create
Creates an empty context options.
kernel_context_options_destroy
Destroy the context options.
kernel_context_options_set_chainparams
@brief Sets the chain params for the context options. The context created with the options will be configured for these chain parameters.
kernel_context_options_set_notifications
@brief Set the kernel notifications for the context options. The context created with the options will be configured with these notifications.
kernel_context_options_set_validation_interface
@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.
kernel_logging_connection_create
@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.
kernel_logging_connection_destroy
Stop logging and destroy the logging connection.
kernel_logging_disable
@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.
kernel_logging_disable_category
@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.
kernel_logging_enable_category
@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.
kernel_logging_set_level_category
@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.
kernel_script_pubkey_copy_data
@brief Copies the script pubkey data into the returned byte array. @param[in] script_pubkey Non-null. @return The serialized script pubkey data.
kernel_script_pubkey_create
@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.
kernel_script_pubkey_destroy
Destroy the script pubkey.
kernel_transaction_create
@brief Create a new transaction from the serialized data.
kernel_transaction_destroy
Destroy the transaction.
kernel_transaction_output_copy_script_pubkey
@brief Copies the script pubkey of an output in the returned script pubkey opaque object.
kernel_transaction_output_create
@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.
kernel_transaction_output_destroy
Destroy the transaction output.
kernel_transaction_output_get_amount
@brief Gets the amount associated with this transaction output
kernel_verify_script
@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.

Type Aliases§

__blkcnt64_t
__blkcnt_t
__blksize_t
__caddr_t
__clock_t
__clockid_t
__daddr_t
__dev_t
__fsblkcnt64_t
__fsblkcnt_t
__fsfilcnt64_t
__fsfilcnt_t
__fsword_t
__gid_t
__id_t
__ino64_t
__ino_t
__int8_t
__int16_t
__int32_t
__int64_t
__int_least8_t
__int_least16_t
__int_least32_t
__int_least64_t
__intmax_t
__intptr_t
__key_t
__loff_t
__mode_t
__nlink_t
__off64_t
__off_t
__pid_t
__quad_t
__rlim64_t
__rlim_t
__sig_atomic_t
__socklen_t
__ssize_t
__suseconds64_t
__suseconds_t
__syscall_slong_t
__syscall_ulong_t
__time_t
__timer_t
__u_char
__u_int
__u_long
__u_quad_t
__u_short
__uid_t
__uint8_t
__uint16_t
__uint32_t
__uint64_t
__uint_least8_t
__uint_least16_t
__uint_least32_t
__uint_least64_t
__uintmax_t
__useconds_t
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
kernel_BlockValidationResult
A granular “reason” why a block was invalid.
kernel_ChainType
Chain type used for creating chain params.
kernel_LogCallback
Function signature for the global logging callback. All bitcoin kernel internal logs will pass through this callback.
kernel_LogCategory
A collection of logging categories that may be encountered by kernel code.
kernel_LogLevel
The level at which logs should be produced.
kernel_NotifyBlockTip
Function signatures for the kernel notifications.
kernel_NotifyFatalError
kernel_NotifyFlushError
kernel_NotifyHeaderTip
kernel_NotifyProgress
kernel_NotifyWarningSet
kernel_NotifyWarningUnset
kernel_ScriptFlags
Script verification flags that may be composed with each other.
kernel_ScriptVerifyStatus
A collection of status codes that may be issued by the script verify function.
kernel_SynchronizationState
Current sync state passed to tip changed callbacks.
kernel_ValidationInterfaceBlockChecked
Function signatures for the validation interface.
kernel_ValidationMode
Whether a validated data structure is valid, invalid, or an error was encountered during processing.
kernel_Warning
Possible warning types issued by validation.
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t
wchar_t