Bitcoin Kernel
C header for interacting with the Bitcoin Kernel library.
Loading...
Searching...
No Matches
bitcoinkernel.h
Go to the documentation of this file.
1// Copyright (c) 2024-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_KERNEL_BITCOINKERNEL_H
6#define BITCOIN_KERNEL_BITCOINKERNEL_H
7
8#ifndef __cplusplus
9#include <stdbool.h>
10#include <stddef.h>
11#include <stdint.h>
12#else
13#include <cstddef>
14#include <cstdint>
15#endif // __cplusplus
16
17
18#if !defined(BITCOINKERNEL_GNUC_PREREQ)
19#if defined(__GNUC__) && defined(__GNUC_MINOR__)
20#define BITCOINKERNEL_GNUC_PREREQ(_maj, _min) \
21 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((_maj) << 16) + (_min))
22#else
23#define BITCOINKERNEL_GNUC_PREREQ(_maj, _min) 0
24#endif
25#endif
26
27/* Warning attributes */
28#if defined(__GNUC__) && BITCOINKERNEL_GNUC_PREREQ(3, 4)
29#define BITCOINKERNEL_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
30#else
31#define BITCOINKERNEL_WARN_UNUSED_RESULT
32#endif
33#if !defined(BITCOINKERNEL_BUILD) && defined(__GNUC__) && BITCOINKERNEL_GNUC_PREREQ(3, 4)
34#define BITCOINKERNEL_ARG_NONNULL(...) __attribute__((__nonnull__(__VA_ARGS__)))
35#else
36#define BITCOINKERNEL_ARG_NONNULL(_x)
37#endif
38
39#ifdef __cplusplus
40extern "C" {
41#endif // __cplusplus
42
94
99
104
115
124
135
154
163
172
181
195
203
208
214
222
232
244
251
257
264typedef void (*kernel_LogCallback)(void* user_data, const char* message, size_t message_len);
265
269typedef void (*kernel_NotifyBlockTip)(void* user_data, kernel_SynchronizationState state, const kernel_BlockIndex* index);
270typedef void (*kernel_NotifyHeaderTip)(void* user_data, kernel_SynchronizationState state, int64_t height, int64_t timestamp, bool presync);
271typedef void (*kernel_NotifyProgress)(void* user_data, const char* title, size_t title_len, int progress_percent, bool resume_possible);
272typedef void (*kernel_NotifyWarningSet)(void* user_data, kernel_Warning warning, const char* message, size_t message_len);
273typedef void (*kernel_NotifyWarningUnset)(void* user_data, kernel_Warning warning);
274typedef void (*kernel_NotifyFlushError)(void* user_data, const char* message, size_t message_len);
275typedef void (*kernel_NotifyFatalError)(void* user_data, const char* message, size_t message_len);
276
280typedef void (*kernel_ValidationInterfaceBlockChecked)(void* user_data, const kernel_BlockPointer* block, const kernel_BlockValidationState* state);
281
291
307
319
338
356
365
376
388
411
422
426typedef struct {
427 unsigned char hash[32];
429
433typedef struct {
434 unsigned char* data;
435 size_t size;
437
442
451 const unsigned char* raw_transaction, size_t raw_transaction_len
453
458
460
465
473 const unsigned char* script_pubkey, size_t script_pubkey_len
475
482 const kernel_ScriptPubkey* script_pubkey
484
489
491
496
504 const kernel_ScriptPubkey* script_pubkey,
505 int64_t amount
507
517
526
531
533
538
560 const kernel_ScriptPubkey* script_pubkey,
561 int64_t amount,
562 const kernel_Transaction* tx_to,
563 const kernel_TransactionOutput** spent_outputs, size_t spent_outputs_len,
564 unsigned int input_index,
565 unsigned int flags,
568
570
575
583
596
604
612
625 kernel_LogCallback callback,
626 const void* user_data,
627 const kernel_LoggingOptions options
629
634
636
641
650 const kernel_ChainType chain_type);
651
656
658
663
668
677 kernel_ContextOptions* context_options,
678 const kernel_ChainParameters* chain_parameters
680
689 kernel_ContextOptions* context_options,
692
704 kernel_ContextOptions* context_options,
705 kernel_ValidationInterfaceCallbacks validation_interface_callbacks
707
712
714
719
730 const kernel_ContextOptions* context_options);
731
740 kernel_Context* context
742
747
749
754
766 const kernel_Context* context,
767 const char* data_directory,
768 size_t data_directory_len
770
780 kernel_ChainstateManagerOptions* chainstate_manager_options,
781 int worker_threads
783
788
790
795
808 const kernel_Context* context,
809 const char* blocks_directory,
810 size_t blocks_directory_len
812
817
819
824
829
837 kernel_ChainstateLoadOptions* chainstate_load_options,
838 bool wipe_block_tree_db
840
848 kernel_ChainstateLoadOptions* chainstate_load_options,
849 bool wipe_chainstate_db
851
859 kernel_ChainstateLoadOptions* chainstate_load_options,
860 bool block_tree_db_in_memory
862
870 kernel_ChainstateLoadOptions* chainstate_load_options,
871 bool chainstate_db_in_memory
873
878
880
885
900 const kernel_Context* context,
901 const kernel_ChainstateManagerOptions* chainstate_manager_options,
902 const kernel_BlockManagerOptions* block_manager_options,
903 const kernel_ChainstateLoadOptions* chainstate_load_options
905
919 kernel_ChainstateManager* chainstate_manager,
920 const char** block_file_paths, size_t* block_file_paths_lens, size_t block_file_paths_len
922
937 const kernel_Context* context,
938 kernel_ChainstateManager* chainstate_manager,
939 kernel_Block* block,
940 bool* new_block
942
947
949
954
965 const kernel_Context* context,
966 kernel_ChainstateManager* chainstate_manager,
967 const kernel_BlockIndex* block_index
969
978 const unsigned char* raw_block, size_t raw_block_len
980
988 kernel_Block* block
990
998 const kernel_BlockPointer* block
1000
1008 kernel_Block* block
1010
1018 const kernel_BlockPointer* block
1020
1025
1027
1032
1037
1039
1044
1049 const kernel_BlockValidationState* block_validation_state
1051
1056 const kernel_BlockValidationState* block_validation_state
1058
1060
1065
1075 const kernel_Context* context,
1076 kernel_ChainstateManager* chainstate_manager
1078
1087 const kernel_Context* context,
1088 kernel_ChainstateManager* chainstate_manager
1090
1100 const kernel_Context* context,
1101 kernel_ChainstateManager* chainstate_manager,
1102 kernel_BlockHash* block_hash
1103) BITCOINKERNEL_ARG_NONNULL(1, 2, 3);
1104
1115 const kernel_Context* context,
1116 kernel_ChainstateManager* chainstate_manager,
1117 int block_height
1119
1131 const kernel_Context* context,
1132 kernel_ChainstateManager* chainstate_manager,
1133 const kernel_BlockIndex* block_index
1134) BITCOINKERNEL_ARG_NONNULL(1, 2, 3);
1135
1144 const kernel_BlockIndex* block_index
1146
1154 const kernel_BlockIndex* block_index
1156
1157
1162
1164
1169
1180 const kernel_Context* context,
1181 kernel_ChainstateManager* chainstate_manager,
1182 const kernel_BlockIndex* block_index
1183) BITCOINKERNEL_ARG_NONNULL(1, 2, 3);
1184
1193 const kernel_BlockUndo* block_undo
1195
1205 const kernel_BlockUndo* block_undo,
1206 uint64_t transaction_undo_index
1208
1220 const kernel_BlockUndo* block_undo,
1221 uint64_t transaction_undo_index,
1222 uint64_t output_index
1224
1229
1231
1236
1244 const kernel_BlockIndex* block_index
1246
1251
1253
1254#ifdef __cplusplus
1255} // extern "C"
1256#endif // __cplusplus
1257
1258#endif // BITCOIN_KERNEL_BITCOINKERNEL_H
void(* kernel_NotifyWarningUnset)(void *user_data, kernel_Warning warning)
Definition bitcoinkernel.h:273
void kernel_chainstate_manager_options_set_worker_threads_num(kernel_ChainstateManagerOptions *chainstate_manager_options, int worker_threads)
Set the number of available worker threads used during validation.
void kernel_logging_connection_destroy(kernel_LoggingConnection *logging_connection)
struct kernel_LoggingConnection kernel_LoggingConnection
Definition bitcoinkernel.h:114
kernel_BlockUndo uint64_t kernel_block_undo_size(const kernel_BlockUndo *block_undo)
Returns the number of transactions whose undo data is contained in block undo.
void kernel_context_options_destroy(kernel_ContextOptions *context_options)
void(* kernel_NotifyWarningSet)(void *user_data, kernel_Warning warning, const char *message, size_t message_len)
Definition bitcoinkernel.h:272
struct kernel_Block kernel_Block
Definition bitcoinkernel.h:207
kernel_BlockIndex * kernel_get_block_index_from_hash(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager, kernel_BlockHash *block_hash) 2
Retrieve a block index by its block hash.
struct kernel_ContextOptions kernel_ContextOptions
Definition bitcoinkernel.h:134
void kernel_transaction_output_destroy(kernel_TransactionOutput *transaction_output)
const kernel_ChainParameters * kernel_chain_parameters_create(const kernel_ChainType chain_type)
Creates a chain parameters struct with default parameters based on the passed in chain type.
void kernel_disable_logging()
This disables the global internal logger. No log messages will be buffered internally anymore once th...
void(* kernel_NotifyHeaderTip)(void *user_data, kernel_SynchronizationState state, int64_t height, int64_t timestamp, bool presync)
Definition bitcoinkernel.h:270
kernel_TransactionOutput * kernel_get_undo_output_by_index(const kernel_BlockUndo *block_undo, uint64_t transaction_undo_index, uint64_t output_index)
Return a transaction output contained in the transaction undo data of a block undo data at a certain ...
kernel_ByteArray * kernel_copy_block_data(kernel_Block *block)
Copies block data into the returned byte array.
kernel_LoggingConnection * kernel_logging_connection_create(kernel_LogCallback callback, const void *user_data, const kernel_LoggingOptions options)
Start logging messages through the provided callback. Log messages produced before this function is f...
kernel_ScriptFlags
Definition bitcoinkernel.h:393
@ kernel_SCRIPT_FLAGS_VERIFY_WITNESS
enable WITNESS (BIP141)
Definition bitcoinkernel.h:400
@ kernel_SCRIPT_FLAGS_VERIFY_ALL
Definition bitcoinkernel.h:403
@ kernel_SCRIPT_FLAGS_VERIFY_NULLDUMMY
enforce NULLDUMMY (BIP147)
Definition bitcoinkernel.h:397
@ kernel_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY
enable CHECKSEQUENCEVERIFY (BIP112)
Definition bitcoinkernel.h:399
@ kernel_SCRIPT_FLAGS_VERIFY_DERSIG
enforce strict DER (BIP66) compliance
Definition bitcoinkernel.h:396
@ kernel_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY
enable CHECKLOCKTIMEVERIFY (BIP65)
Definition bitcoinkernel.h:398
@ kernel_SCRIPT_FLAGS_VERIFY_NONE
Definition bitcoinkernel.h:394
@ kernel_SCRIPT_FLAGS_VERIFY_P2SH
evaluate P2SH (BIP16) subscripts
Definition bitcoinkernel.h:395
@ kernel_SCRIPT_FLAGS_VERIFY_TAPROOT
enable TAPROOT (BIPs 341 & 342)
Definition bitcoinkernel.h:402
void kernel_context_options_set_validation_interface(kernel_ContextOptions *context_options, kernel_ValidationInterfaceCallbacks validation_interface_callbacks)
Set the validation interface callbacks for the context options. The context created with the options ...
void kernel_chainstate_load_options_set_wipe_block_tree_db(kernel_ChainstateLoadOptions *chainstate_load_options, bool wipe_block_tree_db)
Sets wipe block tree db in the chainstate load options.
#define BITCOINKERNEL_WARN_UNUSED_RESULT
Definition bitcoinkernel.h:31
kernel_Block * kernel_read_block_from_disk(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager, const kernel_BlockIndex *block_index) 2
Reads the block the passed in block index points to from disk and returns it.
void kernel_chain_parameters_destroy(const kernel_ChainParameters *chain_parameters)
kernel_BlockHash * kernel_block_pointer_get_hash(const kernel_BlockPointer *block)
void kernel_chainstate_load_options_destroy(kernel_ChainstateLoadOptions *chainstate_load_options)
kernel_SynchronizationState
Definition bitcoinkernel.h:246
@ kernel_INIT_DOWNLOAD
Definition bitcoinkernel.h:248
@ kernel_POST_INIT
Definition bitcoinkernel.h:249
@ kernel_INIT_REINDEX
Definition bitcoinkernel.h:247
void kernel_chainstate_load_options_set_wipe_chainstate_db(kernel_ChainstateLoadOptions *chainstate_load_options, bool wipe_chainstate_db)
Sets wipe chainstate db in the chainstate load options.
kernel_ValidationMode
Definition bitcoinkernel.h:286
@ kernel_VALIDATION_STATE_INVALID
Definition bitcoinkernel.h:288
@ kernel_VALIDATION_STATE_ERROR
Definition bitcoinkernel.h:289
@ kernel_VALIDATION_STATE_VALID
Definition bitcoinkernel.h:287
void(* kernel_LogCallback)(void *user_data, const char *message, size_t message_len)
Definition bitcoinkernel.h:264
void kernel_block_destroy(kernel_Block *block)
void(* kernel_NotifyBlockTip)(void *user_data, kernel_SynchronizationState state, const kernel_BlockIndex *index)
Definition bitcoinkernel.h:269
bool kernel_verify_script(const kernel_ScriptPubkey *script_pubkey, int64_t amount, const kernel_Transaction *tx_to, const kernel_TransactionOutput **spent_outputs, size_t spent_outputs_len, unsigned int input_index, unsigned int flags, kernel_ScriptVerifyStatus *status) 3)
Verify if the input at input_index of tx_to spends the script pubkey under the constraints specified ...
kernel_ChainType
Definition bitcoinkernel.h:415
@ kernel_CHAIN_TYPE_REGTEST
Definition bitcoinkernel.h:420
@ kernel_CHAIN_TYPE_TESTNET_4
Definition bitcoinkernel.h:418
@ kernel_CHAIN_TYPE_MAINNET
Definition bitcoinkernel.h:416
@ kernel_CHAIN_TYPE_SIGNET
Definition bitcoinkernel.h:419
@ kernel_CHAIN_TYPE_TESTNET
Definition bitcoinkernel.h:417
bool void kernel_chainstate_manager_destroy(kernel_ChainstateManager *chainstate_manager, const kernel_Context *context)
bool kernel_chainstate_manager_process_block(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager, kernel_Block *block, bool *new_block) 2
Process and validate the passed in block with the chainstate manager. More detailed validation inform...
struct kernel_ChainParameters kernel_ChainParameters
Definition bitcoinkernel.h:123
struct kernel_BlockValidationState kernel_BlockValidationState
Definition bitcoinkernel.h:221
kernel_BlockManagerOptions * kernel_block_manager_options_create(const kernel_Context *context, const char *blocks_directory, size_t blocks_directory_len) 2)
Create options for the block manager. The block manager is used internally by the chainstate manager ...
void(* kernel_ValidationInterfaceBlockChecked)(void *user_data, const kernel_BlockPointer *block, const kernel_BlockValidationState *state)
Definition bitcoinkernel.h:280
void kernel_script_pubkey_destroy(kernel_ScriptPubkey *script_pubkey)
void kernel_block_index_destroy(kernel_BlockIndex *block_index)
Destroy the block index.
void kernel_chainstate_manager_options_destroy(kernel_ChainstateManagerOptions *chainstate_manager_options)
kernel_ScriptPubkey * kernel_script_pubkey_create(const unsigned char *script_pubkey, size_t script_pubkey_len)
Create a script pubkey from serialized data.
kernel_BlockIndex kernel_BlockIndex * kernel_get_block_index_from_height(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager, int block_height) 2)
Retrieve a block index by its height in the currently active chain. Once retrieved there is no guaran...
kernel_BlockIndex * kernel_get_next_block_index(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager, const kernel_BlockIndex *block_index) 2
Return the next block index in the currently active chain, or null if the current block index is the ...
void(* kernel_NotifyProgress)(void *user_data, const char *title, size_t title_len, int progress_percent, bool resume_possible)
Definition bitcoinkernel.h:271
kernel_ScriptPubkey * kernel_copy_script_pubkey_from_output(kernel_TransactionOutput *transaction_output)
Copies the script pubkey of an output in the returned script pubkey opaque object.
struct kernel_BlockManagerOptions kernel_BlockManagerOptions
Definition bitcoinkernel.h:180
struct kernel_BlockUndo kernel_BlockUndo
Definition bitcoinkernel.h:243
kernel_TransactionOutput * kernel_transaction_output_create(const kernel_ScriptPubkey *script_pubkey, int64_t amount)
Create a transaction output from a script pubkey and an amount.
void(* kernel_NotifyFlushError)(void *user_data, const char *message, size_t message_len)
Definition bitcoinkernel.h:274
kernel_Context * kernel_context_create(const kernel_ContextOptions *context_options)
Create a new kernel context. If the options have not been previously set, their corresponding fields ...
kernel_ChainstateLoadOptions * kernel_chainstate_load_options_create()
void kernel_chainstate_load_options_set_block_tree_db_in_memory(kernel_ChainstateLoadOptions *chainstate_load_options, bool block_tree_db_in_memory)
Sets block tree db in memory in the chainstate load options.
struct kernel_TransactionOutput kernel_TransactionOutput
Definition bitcoinkernel.h:103
struct kernel_Transaction kernel_Transaction
Definition bitcoinkernel.h:93
kernel_ChainstateManager * kernel_chainstate_manager_create(const kernel_Context *context, const kernel_ChainstateManagerOptions *chainstate_manager_options, const kernel_BlockManagerOptions *block_manager_options, const kernel_ChainstateLoadOptions *chainstate_load_options) 2
Create a chainstate manager. This is the main object for many validation tasks as well as for retriev...
bool kernel_add_log_level_category(const kernel_LogCategory category, kernel_LogLevel level)
Set the log level of the global internal logger. This does not enable the selected categories....
kernel_ChainstateManagerOptions * kernel_chainstate_manager_options_create(const kernel_Context *context, const char *data_directory, size_t data_directory_len) 2)
Create options for the chainstate manager.
kernel_ValidationMode kernel_get_validation_mode_from_block_validation_state(const kernel_BlockValidationState *block_validation_state)
kernel_ContextOptions * kernel_context_options_create()
void kernel_context_options_set_notifications(kernel_ContextOptions *context_options, kernel_NotificationInterfaceCallbacks notifications)
Set the kernel notifications for the context options. The context created with the options will be co...
struct kernel_ChainstateLoadOptions kernel_ChainstateLoadOptions
Definition bitcoinkernel.h:202
void kernel_block_hash_destroy(kernel_BlockHash *block_hash)
kernel_Transaction * kernel_transaction_create(const unsigned char *raw_transaction, size_t raw_transaction_len)
Create a new transaction from the serialized data.
kernel_BlockValidationResult
Definition bitcoinkernel.h:295
@ kernel_BLOCK_HEADER_LOW_WORK
the block header may be on a too-little-work chain
Definition bitcoinkernel.h:305
@ kernel_BLOCK_MUTATED
the block's data didn't match the data committed to by the PoW
Definition bitcoinkernel.h:300
@ kernel_BLOCK_CACHED_INVALID
this block was cached as being invalid and we didn't store the reason why
Definition bitcoinkernel.h:298
@ kernel_BLOCK_INVALID_HEADER
invalid proof of work or time too old
Definition bitcoinkernel.h:299
@ kernel_BLOCK_TIME_FUTURE
block timestamp was > 2 hours in the future (or our clock is bad)
Definition bitcoinkernel.h:303
@ kernel_BLOCK_RESULT_UNSET
initial value. Block has not yet been rejected
Definition bitcoinkernel.h:296
@ kernel_BLOCK_INVALID_PREV
A block this one builds on is invalid.
Definition bitcoinkernel.h:302
@ kernel_BLOCK_MISSING_PREV
We don't have the previous block the checked one is built on.
Definition bitcoinkernel.h:301
@ kernel_BLOCK_CONSENSUS
invalid by consensus rules (excluding any below reasons)
Definition bitcoinkernel.h:297
@ kernel_BLOCK_CHECKPOINT
the block failed to meet one of our checkpoints
Definition bitcoinkernel.h:304
kernel_Block kernel_Block * kernel_block_create(const unsigned char *raw_block, size_t raw_block_len)
Parse a serialized raw block into a new block object.
kernel_ChainstateManager bool kernel_import_blocks(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager, const char **block_file_paths, size_t *block_file_paths_lens, size_t block_file_paths_len) 2)
May be called after kernel_chainstate_manager_load_chainstate to initialize the chainstate manager....
kernel_BlockHash * kernel_block_get_hash(kernel_Block *block)
Calculate and return the hash of a block.
struct kernel_ValidationInterface kernel_ValidationInterface
Definition bitcoinkernel.h:231
#define BITCOINKERNEL_ARG_NONNULL(_x)
Definition bitcoinkernel.h:36
kernel_BlockIndex kernel_BlockIndex * kernel_get_previous_block_index(const kernel_BlockIndex *block_index)
Returns the previous block index in the chain, or null if the current block index entry is the genesi...
struct kernel_BlockPointer kernel_BlockPointer
Definition bitcoinkernel.h:213
void kernel_context_destroy(kernel_Context *context)
kernel_LogLevel
Definition bitcoinkernel.h:360
@ kernel_LOG_TRACE
Definition bitcoinkernel.h:363
@ kernel_LOG_DEBUG
Definition bitcoinkernel.h:362
@ kernel_LOG_INFO
Definition bitcoinkernel.h:361
int64_t kernel_get_transaction_output_amount(kernel_TransactionOutput *transaction_output)
Gets the amount associated with this transaction output.
struct kernel_ScriptPubkey kernel_ScriptPubkey
Definition bitcoinkernel.h:98
bool kernel_enable_log_category(const kernel_LogCategory category)
Enable a specific log category for the global internal logger.
void kernel_byte_array_destroy(kernel_ByteArray *byte_array)
kernel_Warning
Definition bitcoinkernel.h:253
@ kernel_LARGE_WORK_INVALID_CHAIN
Definition bitcoinkernel.h:255
@ kernel_UNKNOWN_NEW_RULES_ACTIVATED
Definition bitcoinkernel.h:254
kernel_BlockUndo * kernel_read_block_undo_from_disk(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager, const kernel_BlockIndex *block_index) 2
Reads the block undo data the passed in block index points to from disk and returns it.
void(* kernel_NotifyFatalError)(void *user_data, const char *message, size_t message_len)
Definition bitcoinkernel.h:275
uint64_t kernel_get_transaction_undo_size(const kernel_BlockUndo *block_undo, uint64_t transaction_undo_index)
Returns the number of previous transaction outputs contained in the transaction undo data.
kernel_BlockHash * kernel_block_index_get_block_hash(const kernel_BlockIndex *block_index)
Return the block hash associated with a block index.
struct kernel_ChainstateManager kernel_ChainstateManager
Definition bitcoinkernel.h:194
kernel_ByteArray * kernel_copy_block_pointer_data(const kernel_BlockPointer *block)
Copies block data into the returned byte array.
void kernel_chainstate_load_options_set_chainstate_db_in_memory(kernel_ChainstateLoadOptions *chainstate_load_options, bool chainstate_db_in_memory)
Sets chainstate db in memory in the chainstate load options.
kernel_ScriptVerifyStatus
Definition bitcoinkernel.h:380
@ kernel_SCRIPT_VERIFY_ERROR_INVALID_FLAGS_COMBINATION
The flags very combined in an invalid way.
Definition bitcoinkernel.h:384
@ kernel_SCRIPT_VERIFY_ERROR_TX_INPUT_INDEX
The provided input index is out of range of the actual number of inputs of the transaction.
Definition bitcoinkernel.h:382
@ kernel_SCRIPT_VERIFY_OK
Definition bitcoinkernel.h:381
@ kernel_SCRIPT_VERIFY_ERROR_INVALID_FLAGS
The provided bitfield for the flags was invalid.
Definition bitcoinkernel.h:383
@ kernel_SCRIPT_VERIFY_ERROR_SPENT_OUTPUTS_REQUIRED
The taproot flag was set, so valid spent_outputs have to be provided.
Definition bitcoinkernel.h:385
@ kernel_SCRIPT_VERIFY_ERROR_SPENT_OUTPUTS_MISMATCH
The number of spent outputs does not match the number of inputs of the tx.
Definition bitcoinkernel.h:386
struct kernel_BlockIndex kernel_BlockIndex
Definition bitcoinkernel.h:162
void kernel_block_manager_options_destroy(kernel_BlockManagerOptions *block_manager_options)
kernel_BlockValidationResult kernel_get_block_validation_result_from_block_validation_state(const kernel_BlockValidationState *block_validation_state)
kernel_BlockIndex * kernel_get_block_index_from_tip(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager) 2)
Get the block index entry of the current chain tip. Once returned, there is no guarantee that it rema...
void kernel_transaction_destroy(kernel_Transaction *transaction)
bool kernel_context_interrupt(kernel_Context *context)
Interrupt can be used to halt long-running validation functions like when reindexing,...
void kernel_context_options_set_chainparams(kernel_ContextOptions *context_options, const kernel_ChainParameters *chain_parameters) 2)
Sets the chain params for the context options. The context created with the options will be configure...
void kernel_block_undo_destroy(kernel_BlockUndo *block_undo)
struct kernel_ChainstateManagerOptions kernel_ChainstateManagerOptions
Definition bitcoinkernel.h:171
kernel_ByteArray * kernel_copy_script_pubkey_data(const kernel_ScriptPubkey *script_pubkey)
Copies the script pubkey data into the returned byte array.
kernel_BlockIndex * kernel_get_block_index_from_genesis(const kernel_Context *context, kernel_ChainstateManager *chainstate_manager) 2)
Get the block index entry of the genesis block.
bool kernel_disable_log_category(const kernel_LogCategory category)
int32_t kernel_block_index_get_height(const kernel_BlockIndex *block_index)
Return the height of a certain block index.
struct kernel_Context kernel_Context
Definition bitcoinkernel.h:153
kernel_LogCategory
Definition bitcoinkernel.h:342
@ kernel_LOG_KERNEL
Definition bitcoinkernel.h:354
@ kernel_LOG_VALIDATION
Definition bitcoinkernel.h:353
@ kernel_LOG_LOCK
Definition bitcoinkernel.h:348
@ kernel_LOG_BENCH
Definition bitcoinkernel.h:344
@ kernel_LOG_LEVELDB
Definition bitcoinkernel.h:347
@ kernel_LOG_PRUNE
Definition bitcoinkernel.h:350
@ kernel_LOG_RAND
Definition bitcoinkernel.h:351
@ kernel_LOG_COINDB
Definition bitcoinkernel.h:346
@ kernel_LOG_BLOCKSTORAGE
Definition bitcoinkernel.h:345
@ kernel_LOG_MEMPOOL
Definition bitcoinkernel.h:349
@ kernel_LOG_ALL
Definition bitcoinkernel.h:343
@ kernel_LOG_REINDEX
Definition bitcoinkernel.h:352
Definition bitcoinkernel.h:426
Definition bitcoinkernel.h:433
unsigned char * data
Definition bitcoinkernel.h:434
size_t size
Definition bitcoinkernel.h:435
Definition bitcoinkernel.h:369
bool log_timestamps
Prepend a timestamp to log messages.
Definition bitcoinkernel.h:370
bool always_print_category_levels
Prepend the log category and level to log messages.
Definition bitcoinkernel.h:374
bool log_threadnames
Prepend the name of the thread to log messages.
Definition bitcoinkernel.h:372
bool log_sourcelocations
Prepend the source location to log messages.
Definition bitcoinkernel.h:373
bool log_time_micros
Log timestamps in microsecond precision.
Definition bitcoinkernel.h:371
Definition bitcoinkernel.h:328
kernel_NotifyProgress progress
Reports on current block synchronization progress.
Definition bitcoinkernel.h:332
kernel_NotifyFatalError fatal_error
A un-recoverable system error encountered by the library.
Definition bitcoinkernel.h:336
kernel_NotifyBlockTip block_tip
The chain's tip was updated to the provided block index.
Definition bitcoinkernel.h:330
kernel_NotifyWarningUnset warning_unset
A previous condition leading to the issuance of a warning is no longer given.
Definition bitcoinkernel.h:334
kernel_NotifyWarningSet warning_set
A warning issued by the kernel library during validation.
Definition bitcoinkernel.h:333
kernel_NotifyFlushError flush_error
An error encountered when flushing data to disk.
Definition bitcoinkernel.h:335
kernel_NotifyHeaderTip header_tip
A new best block header was added.
Definition bitcoinkernel.h:331
const void * user_data
Holds a user-defined opaque structure that is passed to the notification callbacks.
Definition bitcoinkernel.h:329
Definition bitcoinkernel.h:313
const void * user_data
Definition bitcoinkernel.h:314
kernel_ValidationInterfaceBlockChecked block_checked
Definition bitcoinkernel.h:316