![]() |
Bitcoin Core 31.0.0
P2P Digital Currency
|
#include <kernel/bitcoinkernel.h>#include <chain.h>#include <coins.h>#include <consensus/validation.h>#include <dbwrapper.h>#include <kernel/caches.h>#include <kernel/chainparams.h>#include <kernel/checks.h>#include <kernel/context.h>#include <kernel/notifications_interface.h>#include <kernel/warning.h>#include <logging.h>#include <node/blockstorage.h>#include <node/chainstate.h>#include <primitives/block.h>#include <primitives/transaction.h>#include <script/interpreter.h>#include <script/script.h>#include <serialize.h>#include <streams.h>#include <sync.h>#include <uint256.h>#include <undo.h>#include <util/check.h>#include <util/fs.h>#include <util/result.h>#include <util/signalinterrupt.h>#include <util/task_runner.h>#include <util/translation.h>#include <validation.h>#include <validationinterface.h>#include <cstddef>#include <cstring>#include <exception>#include <functional>#include <list>#include <memory>#include <span>#include <stdexcept>#include <string>#include <tuple>#include <utility>#include <vector>Go to the source code of this file.
Classes | |
| struct | btck_BlockTreeEntry |
| struct | btck_Block |
| struct | btck_BlockValidationState |
| struct | btck_Transaction |
| struct | btck_TransactionOutput |
| struct | btck_ScriptPubkey |
| struct | btck_LoggingConnection |
| struct | btck_ContextOptions |
| struct | btck_Context |
| struct | btck_ChainParameters |
| struct | btck_ChainstateManagerOptions |
| struct | btck_ChainstateManager |
| struct | btck_Chain |
| struct | btck_BlockSpentOutputs |
| struct | btck_TransactionSpentOutputs |
| struct | btck_Coin |
| struct | btck_BlockHash |
| struct | btck_TransactionInput |
| struct | btck_TransactionOutPoint |
| struct | btck_Txid |
| struct | btck_PrecomputedTransactionData |
| struct | btck_BlockHeader |
Macros | |
| #define | BITCOINKERNEL_BUILD |
Variables | |
| const TranslateFn | G_TRANSLATION_FUN {nullptr} |
| static const kernel::Context | btck_context_static {} |
| #define BITCOINKERNEL_BUILD |
Definition at line 5 of file bitcoinkernel.cpp.
| btck_Block * btck_block_copy | ( | const btck_Block * | block | ) |
Copy a block.
Blocks are reference counted, so this just increments the reference count.
| [in] | block | Non-null. |
Definition at line 1107 of file bitcoinkernel.cpp.
| size_t btck_block_count_transactions | ( | const btck_Block * | block | ) |
Count the number of transactions contained in a block.
| [in] | block | Non-null. |
Definition at line 1112 of file bitcoinkernel.cpp.
| btck_Block * btck_block_create | ( | const void * | raw_block, |
| size_t | raw_block_len ) |
Parse a serialized raw block into a new block object.
| [in] | raw_block | Serialized block. |
| [in] | raw_block_len | Length of the serialized block. |
Definition at line 1088 of file bitcoinkernel.cpp.
| void btck_block_destroy | ( | btck_Block * | block | ) |
Destroy the block.
Definition at line 1145 of file bitcoinkernel.cpp.
| btck_BlockHash * btck_block_get_hash | ( | const btck_Block * | block | ) |
Calculate and return the hash of a block.
| [in] | block | Non-null. |
Definition at line 1140 of file bitcoinkernel.cpp.
| btck_BlockHeader * btck_block_get_header | ( | const btck_Block * | block | ) |
Get the btck_BlockHeader from the block.
Creates a new btck_BlockHeader object from the block's header data.
| [in] | block | Non-null btck_Block |
Definition at line 1123 of file bitcoinkernel.cpp.
| const btck_Transaction * btck_block_get_transaction_at | ( | const btck_Block * | block, |
| size_t | transaction_index ) |
Get the transaction at the provided index.
The returned transaction is not owned and depends on the lifetime of the block.
| [in] | block | Non-null. |
| [in] | transaction_index | The index of the transaction to be retrieved. |
Definition at line 1117 of file bitcoinkernel.cpp.
| btck_BlockHash * btck_block_hash_copy | ( | const btck_BlockHash * | block_hash | ) |
Copy a block hash.
| [in] | block_hash | Non-null. |
Definition at line 1185 of file bitcoinkernel.cpp.
| btck_BlockHash * btck_block_hash_create | ( | const unsigned char | block_hash[32] | ) |
Create a block hash from its raw data.
Definition at line 1180 of file bitcoinkernel.cpp.
| void btck_block_hash_destroy | ( | btck_BlockHash * | hash | ) |
Destroy the block hash.
Definition at line 1200 of file bitcoinkernel.cpp.
| int btck_block_hash_equals | ( | const btck_BlockHash * | hash1, |
| const btck_BlockHash * | hash2 ) |
Definition at line 1195 of file bitcoinkernel.cpp.
| void btck_block_hash_to_bytes | ( | const btck_BlockHash * | block_hash, |
| unsigned char | output[32] ) |
| btck_BlockHeader * btck_block_header_copy | ( | const btck_BlockHeader * | header | ) |
Copy a btck_BlockHeader.
| [in] | header | Non-null btck_BlockHeader. |
Definition at line 1358 of file bitcoinkernel.cpp.
| btck_BlockHeader * btck_block_header_create | ( | const void * | raw_block_header, |
| size_t | raw_block_header_len ) |
Create a btck_BlockHeader from serialized data.
| [in] | raw_block_header | Non-null, serialized header data (80 bytes) |
| [in] | raw_block_header_len | Length of serialized header (must be 80) |
Definition at line 1340 of file bitcoinkernel.cpp.
| void btck_block_header_destroy | ( | btck_BlockHeader * | header | ) |
Destroy the btck_BlockHeader.
Definition at line 1393 of file bitcoinkernel.cpp.
| uint32_t btck_block_header_get_bits | ( | const btck_BlockHeader * | header | ) |
Get the nBits difficulty target from btck_BlockHeader.
| [in] | header | Non-null btck_BlockHeader |
Definition at line 1378 of file bitcoinkernel.cpp.
| btck_BlockHash * btck_block_header_get_hash | ( | const btck_BlockHeader * | header | ) |
Get the btck_BlockHash.
| [in] | header | Non-null header |
Definition at line 1363 of file bitcoinkernel.cpp.
| uint32_t btck_block_header_get_nonce | ( | const btck_BlockHeader * | header | ) |
Get the nonce from btck_BlockHeader.
| [in] | header | Non-null btck_BlockHeader |
Definition at line 1388 of file bitcoinkernel.cpp.
| const btck_BlockHash * btck_block_header_get_prev_hash | ( | const btck_BlockHeader * | header | ) |
Get the previous btck_BlockHash from btck_BlockHeader.
The returned hash is unowned and only valid for the lifetime of the btck_BlockHeader.
| [in] | header | Non-null btck_BlockHeader |
Definition at line 1368 of file bitcoinkernel.cpp.
| uint32_t btck_block_header_get_timestamp | ( | const btck_BlockHeader * | header | ) |
Get the timestamp from btck_BlockHeader.
| [in] | header | Non-null btck_BlockHeader |
Definition at line 1373 of file bitcoinkernel.cpp.
| int32_t btck_block_header_get_version | ( | const btck_BlockHeader * | header | ) |
Get the version from btck_BlockHeader.
| [in] | header | Non-null btck_BlockHeader |
Definition at line 1383 of file bitcoinkernel.cpp.
| btck_Block * btck_block_read | ( | const btck_ChainstateManager * | chainman, |
| const btck_BlockTreeEntry * | entry ) |
| btck_BlockSpentOutputs * btck_block_spent_outputs_copy | ( | const btck_BlockSpentOutputs * | block_spent_outputs | ) |
Copy a block's spent outputs.
| [in] | block_spent_outputs | Non-null. |
Definition at line 1219 of file bitcoinkernel.cpp.
| size_t btck_block_spent_outputs_count | ( | const btck_BlockSpentOutputs * | block_spent_outputs | ) |
Returns the number of transaction spent outputs whose data is contained in block spent outputs.
| [in] | block_spent_outputs | Non-null. |
Definition at line 1224 of file bitcoinkernel.cpp.
| void btck_block_spent_outputs_destroy | ( | btck_BlockSpentOutputs * | block_spent_outputs | ) |
Destroy the block spent outputs.
Definition at line 1236 of file bitcoinkernel.cpp.
| const btck_TransactionSpentOutputs * btck_block_spent_outputs_get_transaction_spent_outputs_at | ( | const btck_BlockSpentOutputs * | block_spent_outputs, |
| size_t | transaction_spent_outputs_index ) |
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.
| [in] | block_spent_outputs | Non-null. |
| [in] | transaction_spent_outputs_index | The index of the transaction spent outputs within the block spent outputs. |
Definition at line 1229 of file bitcoinkernel.cpp.
| btck_BlockSpentOutputs * btck_block_spent_outputs_read | ( | const btck_ChainstateManager * | chainman, |
| const btck_BlockTreeEntry * | entry ) |
Definition at line 1205 of file bitcoinkernel.cpp.
| int btck_block_to_bytes | ( | const btck_Block * | block, |
| btck_WriteBytes | writer, | ||
| void * | user_data ) |
Definition at line 1129 of file bitcoinkernel.cpp.
| int btck_block_tree_entry_equals | ( | const btck_BlockTreeEntry * | entry1, |
| const btck_BlockTreeEntry * | entry2 ) |
Definition at line 1175 of file bitcoinkernel.cpp.
| const btck_BlockHash * btck_block_tree_entry_get_block_hash | ( | const btck_BlockTreeEntry * | block_tree_entry | ) |
Return the block hash associated with a block tree entry.
| [in] | block_tree_entry | Non-null. |
Definition at line 1170 of file bitcoinkernel.cpp.
| btck_BlockHeader * btck_block_tree_entry_get_block_header | ( | const btck_BlockTreeEntry * | block_tree_entry | ) |
Return the btck_BlockHeader associated with this entry.
| [in] | block_tree_entry | Non-null. |
Definition at line 1160 of file bitcoinkernel.cpp.
| int32_t btck_block_tree_entry_get_height | ( | const btck_BlockTreeEntry * | block_tree_entry | ) |
Return the height of a certain block tree entry.
| [in] | block_tree_entry | Non-null. |
Definition at line 1165 of file bitcoinkernel.cpp.
| const btck_BlockTreeEntry * btck_block_tree_entry_get_previous | ( | const btck_BlockTreeEntry * | block_tree_entry | ) |
Returns the previous block tree entry in the tree, or null if the current block tree entry is the genesis block.
| [in] | block_tree_entry | Non-null. |
Definition at line 878 of file bitcoinkernel.cpp.
| btck_BlockValidationState * btck_block_validation_state_copy | ( | const btck_BlockValidationState * | block_validation_state | ) |
Copies the btck_BlockValidationState.
| [in] | block_validation_state | Non-null. |
Definition at line 893 of file bitcoinkernel.cpp.
| btck_BlockValidationState * btck_block_validation_state_create | ( | ) |
Create a new btck_BlockValidationState.
Definition at line 888 of file bitcoinkernel.cpp.
| void btck_block_validation_state_destroy | ( | btck_BlockValidationState * | state | ) |
Destroy the btck_BlockValidationState.
Definition at line 898 of file bitcoinkernel.cpp.
| btck_BlockValidationResult btck_block_validation_state_get_block_validation_result | ( | const btck_BlockValidationState * | block_validation_state_ | ) |
Returns the validation result from an opaque btck_BlockValidationState pointer.
Definition at line 911 of file bitcoinkernel.cpp.
| btck_ValidationMode btck_block_validation_state_get_validation_mode | ( | const btck_BlockValidationState * | block_validation_state_ | ) |
Returns the validation mode from an opaque btck_BlockValidationState pointer.
Definition at line 903 of file bitcoinkernel.cpp.
| int btck_chain_contains | ( | const btck_Chain * | chain, |
| const btck_BlockTreeEntry * | entry ) |
| const btck_BlockTreeEntry * btck_chain_get_by_height | ( | const btck_Chain * | chain, |
| int | block_height ) |
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.
| [in] | chain | Non-null. |
| [in] | block_height | Height in the chain of the to be retrieved block tree entry. |
Definition at line 1328 of file bitcoinkernel.cpp.
| int btck_chain_get_height | ( | const btck_Chain * | chain | ) |
Return the height of the tip of the chain.
| [in] | chain | Non-null. |
Definition at line 1322 of file bitcoinkernel.cpp.
| btck_ChainParameters * btck_chain_parameters_copy | ( | const btck_ChainParameters * | chain_parameters | ) |
Copy the chain parameters.
Definition at line 811 of file bitcoinkernel.cpp.
| btck_ChainParameters * btck_chain_parameters_create | ( | btck_ChainType | chain_type | ) |
Creates a chain parameters struct with default parameters based on the passed in chain type.
| [in] | chain_type | Controls the chain parameters type created. |
Definition at line 789 of file bitcoinkernel.cpp.
| void btck_chain_parameters_destroy | ( | btck_ChainParameters * | chain_parameters | ) |
Destroy the chain parameters.
Definition at line 816 of file bitcoinkernel.cpp.
| btck_ChainstateManager * btck_chainstate_manager_create | ( | const btck_ChainstateManagerOptions * | chainstate_manager_options | ) |
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.
| [in] | chainstate_manager_options | Non-null, created by btck_chainstate_manager_options_create. |
Definition at line 997 of file bitcoinkernel.cpp.
| void btck_chainstate_manager_destroy | ( | btck_ChainstateManager * | chainman | ) |
Destroy the chainstate manager.
Definition at line 1053 of file bitcoinkernel.cpp.
| const btck_Chain * btck_chainstate_manager_get_active_chain | ( | const btck_ChainstateManager * | chainstate_manager | ) |
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.
| [in] | chainstate_manager | Non-null. |
Definition at line 1317 of file bitcoinkernel.cpp.
| const btck_BlockTreeEntry * btck_chainstate_manager_get_best_entry | ( | const btck_ChainstateManager * | chainstate_manager | ) |
Get the btck_BlockTreeEntry whose associated btck_BlockHeader has the most known cumulative proof of work.
| [in] | chainstate_manager | Non-null. |
Definition at line 1047 of file bitcoinkernel.cpp.
| const btck_BlockTreeEntry * btck_chainstate_manager_get_block_tree_entry_by_hash | ( | const btck_ChainstateManager * | chainman, |
| const btck_BlockHash * | block_hash ) |
Definition at line 1036 of file bitcoinkernel.cpp.
| int btck_chainstate_manager_import_blocks | ( | btck_ChainstateManager * | chainstate_manager, |
| const char ** | block_file_paths_data, | ||
| size_t * | block_file_paths_lens, | ||
| size_t | block_file_paths_data_len ) |
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.
| [in] | chainstate_manager | Non-null. |
| [in] | block_file_paths_data | Nullable, array of block files described by their full filesystem paths. |
| [in] | block_file_paths_lens | Nullable, array containing the lengths of each of the paths. |
| [in] | block_file_paths_data_len | Length of the block_file_paths_data and block_file_paths_len arrays. |
Definition at line 1068 of file bitcoinkernel.cpp.
| btck_ChainstateManagerOptions * btck_chainstate_manager_options_create | ( | const btck_Context * | context, |
| const char * | data_directory, | ||
| size_t | data_directory_len, | ||
| const char * | blocks_directory, | ||
| size_t | blocks_directory_len ) |
Create options for the chainstate manager.
| [in] | context | Non-null, the created options and through it the chainstate manager will associate with this kernel context for the duration of their lifetimes. |
| [in] | data_directory | Non-null, non-empty path string of the directory containing the chainstate data. If the directory does not exist yet, it will be created. |
| [in] | blocks_directory | Non-null, non-empty path string of the directory containing the block data. If the directory does not exist yet, it will be created. |
Definition at line 937 of file bitcoinkernel.cpp.
| void btck_chainstate_manager_options_destroy | ( | btck_ChainstateManagerOptions * | options | ) |
Destroy the chainstate manager options.
Definition at line 961 of file bitcoinkernel.cpp.
| int btck_chainstate_manager_options_set_wipe_dbs | ( | btck_ChainstateManagerOptions * | chainstate_manager_options, |
| int | wipe_block_tree_db, | ||
| int | wipe_chainstate_db ) |
Sets wipe db in the options.
In combination with calling btck_chainstate_manager_import_blocks this triggers either a full reindex, or a reindex of just the chainstate database.
| [in] | chainstate_manager_options | Non-null, created by btck_chainstate_manager_options_create. |
| [in] | wipe_block_tree_db | Set wipe block tree db. Should only be 1 if wipe_chainstate_db is 1 too. |
| [in] | wipe_chainstate_db | Set wipe chainstate db. |
Definition at line 966 of file bitcoinkernel.cpp.
| void btck_chainstate_manager_options_set_worker_threads_num | ( | btck_ChainstateManagerOptions * | chainstate_manager_options, |
| int | worker_threads ) |
Set the number of available worker threads used during validation.
| [in] | chainstate_manager_options | Non-null, options to be set. |
| [in] | worker_threads | The number of worker threads that should be spawned in the thread pool used for validation. When set to 0 no parallel verification is done. The value range is clamped internally between 0 and 15. |
Definition at line 955 of file bitcoinkernel.cpp.
| void btck_chainstate_manager_options_update_block_tree_db_in_memory | ( | btck_ChainstateManagerOptions * | chainstate_manager_options, |
| int | block_tree_db_in_memory ) |
Sets block tree db in memory in the options.
| [in] | chainstate_manager_options | Non-null, created by btck_chainstate_manager_options_create. |
| [in] | block_tree_db_in_memory | Set block tree db in memory. |
Definition at line 979 of file bitcoinkernel.cpp.
| void btck_chainstate_manager_options_update_chainstate_db_in_memory | ( | btck_ChainstateManagerOptions * | chainstate_manager_options, |
| int | chainstate_db_in_memory ) |
Sets chainstate db in memory in the options.
| [in] | chainstate_manager_options | Non-null, created by btck_chainstate_manager_options_create. |
| [in] | chainstate_db_in_memory | Set chainstate db in memory. |
Definition at line 988 of file bitcoinkernel.cpp.
| int btck_chainstate_manager_process_block | ( | btck_ChainstateManager * | chainman, |
| const btck_Block * | block, | ||
| int * | _new_block ) |
Definition at line 1288 of file bitcoinkernel.cpp.
| int btck_chainstate_manager_process_block_header | ( | btck_ChainstateManager * | chainstate_manager, |
| const btck_BlockHeader * | header, | ||
| btck_BlockValidationState * | state ) |
Definition at line 1301 of file bitcoinkernel.cpp.
Returns the block height where the transaction that created this coin was included in.
| [in] | coin | Non-null. |
Definition at line 1268 of file bitcoinkernel.cpp.
Copy a coin.
| [in] | coin | Non-null. |
Definition at line 1263 of file bitcoinkernel.cpp.
Destroy the coin.
Definition at line 1283 of file bitcoinkernel.cpp.
| const btck_TransactionOutput * btck_coin_get_output | ( | const btck_Coin * | coin | ) |
Return the transaction output of a coin.
The returned pointer is unowned and only valid for the lifetime of the coin.
| [in] | coin | Non-null. |
Definition at line 1278 of file bitcoinkernel.cpp.
Returns whether the containing transaction was a coinbase.
| [in] | coin | Non-null. |
Definition at line 1273 of file bitcoinkernel.cpp.
| btck_Context * btck_context_copy | ( | const btck_Context * | context | ) |
Copy the context.
Definition at line 863 of file bitcoinkernel.cpp.
| btck_Context * btck_context_create | ( | const btck_ContextOptions * | context_options | ) |
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.
| [in] | context_options | Nullable, created by btck_context_options_create. |
Definition at line 851 of file bitcoinkernel.cpp.
| void btck_context_destroy | ( | btck_Context * | context | ) |
Destroy the context.
Definition at line 873 of file bitcoinkernel.cpp.
| int btck_context_interrupt | ( | btck_Context * | context | ) |
Interrupt can be used to halt long-running validation functions like when reindexing, importing or processing blocks.
| [in] | context | Non-null. |
Definition at line 868 of file bitcoinkernel.cpp.
| btck_ContextOptions * btck_context_options_create | ( | ) |
Creates an empty context options.
Definition at line 821 of file bitcoinkernel.cpp.
| void btck_context_options_destroy | ( | btck_ContextOptions * | options | ) |
Destroy the context options.
Definition at line 846 of file bitcoinkernel.cpp.
| void btck_context_options_set_chainparams | ( | btck_ContextOptions * | options, |
| const btck_ChainParameters * | chain_parameters ) |
Definition at line 826 of file bitcoinkernel.cpp.
| void btck_context_options_set_notifications | ( | btck_ContextOptions * | context_options, |
| btck_NotificationInterfaceCallbacks | notifications ) |
Set the kernel notifications for the context options.
The context created with the options will be configured with these notifications.
| [in] | context_options | Non-null, previously created by btck_context_options_create. |
| [in] | notifications | Is set to the context options. |
Definition at line 833 of file bitcoinkernel.cpp.
| void btck_context_options_set_validation_interface | ( | btck_ContextOptions * | context_options, |
| btck_ValidationInterfaceCallbacks | validation_interface_callbacks ) |
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.
| [in] | context_options | Non-null, previously created with btck_context_options_create. |
| [in] | validation_interface_callbacks | The callbacks used for passing validation information to the user. |
Definition at line 840 of file bitcoinkernel.cpp.
| btck_LoggingConnection * btck_logging_connection_create | ( | btck_LogCallback | log_callback, |
| void * | user_data, | ||
| btck_DestroyCallback | user_data_destroy_callback ) |
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.
| [in] | log_callback | Non-null, function through which messages will be logged. |
| [in] | user_data | Nullable, holds a user-defined opaque structure. Is passed back to the user through the callback. If the user_data_destroy_callback is also defined it is assumed that ownership of the user_data is passed to the created logging connection. |
| [in] | user_data_destroy_callback | Nullable, function for freeing the user data. |
Definition at line 775 of file bitcoinkernel.cpp.
| void btck_logging_connection_destroy | ( | btck_LoggingConnection * | connection | ) |
Stop logging and destroy the logging connection.
Definition at line 784 of file bitcoinkernel.cpp.
| void btck_logging_disable | ( | ) |
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.
Definition at line 770 of file bitcoinkernel.cpp.
| void btck_logging_disable_category | ( | btck_LogCategory | category | ) |
Disable a specific log category for the global internal logger.
This changes a global setting and will override settings for all existing btck_LoggingConnection instances.
| [in] | category | If btck_LogCategory_ALL is chosen, all categories will be disabled. |
Definition at line 765 of file bitcoinkernel.cpp.
| void btck_logging_enable_category | ( | btck_LogCategory | category | ) |
Enable a specific log category for the global internal logger.
This changes a global setting and will override settings for all existing btck_LoggingConnection instances.
| [in] | category | If btck_LogCategory_ALL is chosen, all categories will be enabled. |
Definition at line 760 of file bitcoinkernel.cpp.
| void btck_logging_set_level_category | ( | btck_LogCategory | category, |
| btck_LogLevel | level ) |
Set the log level of the global internal logger.
This does not enable the selected categories. Use 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 btck_LoggingConnection instances.
| [in] | category | If btck_LogCategory_ALL is chosen, sets both the global fallback log level used by all categories that don't have a specific level set, and also sets the log level for messages logged with the btck_LogCategory_ALL category itself. For any other category, sets a category-specific log level that overrides the global fallback for that category only. |
| [in] | level | Log level at which the log category is set. |
Definition at line 750 of file bitcoinkernel.cpp.
| void btck_logging_set_options | ( | btck_LoggingOptions | options | ) |
Set some options for the global internal logger.
This changes global settings and will override settings for all existing btck_LoggingConnection instances.
| [in] | options | Sets formatting options of the log messages. |
Definition at line 740 of file bitcoinkernel.cpp.
| btck_PrecomputedTransactionData * btck_precomputed_transaction_data_copy | ( | const btck_PrecomputedTransactionData * | precomputed_txdata | ) |
Copy precomputed transaction data.
| [in] | precomputed_txdata | Non-null. |
Definition at line 638 of file bitcoinkernel.cpp.
| btck_PrecomputedTransactionData * btck_precomputed_transaction_data_create | ( | const btck_Transaction * | tx_to, |
| const btck_TransactionOutput ** | spent_outputs, | ||
| size_t | spent_outputs_len ) |
Create precomputed transaction data for script verification.
| [in] | tx_to | Non-null. |
| [in] | spent_outputs | Nullable for non-taproot verification. Points to an array of outputs spent by the transaction. |
| [in] | spent_outputs_len | Length of the spent_outputs array. |
Definition at line 612 of file bitcoinkernel.cpp.
| void btck_precomputed_transaction_data_destroy | ( | btck_PrecomputedTransactionData * | precomputed_txdata | ) |
Destroy the precomputed transaction data.
Definition at line 643 of file bitcoinkernel.cpp.
| btck_ScriptPubkey * btck_script_pubkey_copy | ( | const btck_ScriptPubkey * | script_pubkey | ) |
Copy a script pubkey.
| [in] | script_pubkey | Non-null. |
Definition at line 577 of file bitcoinkernel.cpp.
| btck_ScriptPubkey * btck_script_pubkey_create | ( | const void * | script_pubkey, |
| size_t | script_pubkey_len ) |
Create a script pubkey from serialized data.
| [in] | script_pubkey | Serialized script pubkey. |
| [in] | script_pubkey_len | Length of the script pubkey data. |
Definition at line 562 of file bitcoinkernel.cpp.
| void btck_script_pubkey_destroy | ( | btck_ScriptPubkey * | script_pubkey | ) |
Destroy the script pubkey.
Definition at line 582 of file bitcoinkernel.cpp.
| int btck_script_pubkey_to_bytes | ( | const btck_ScriptPubkey * | script_pubkey_, |
| btck_WriteBytes | writer, | ||
| void * | user_data ) |
Definition at line 571 of file bitcoinkernel.cpp.
| int btck_script_pubkey_verify | ( | const btck_ScriptPubkey * | script_pubkey, |
| const int64_t | amount, | ||
| const btck_Transaction * | tx_to, | ||
| const btck_PrecomputedTransactionData * | precomputed_txdata, | ||
| const unsigned int | input_index, | ||
| const btck_ScriptVerificationFlags | flags, | ||
| btck_ScriptVerifyStatus * | status ) |
Definition at line 648 of file bitcoinkernel.cpp.
| btck_Transaction * btck_transaction_copy | ( | const btck_Transaction * | transaction | ) |
Copy a transaction.
Transactions are reference counted, so this just increments the reference count.
| [in] | transaction | Non-null. |
Definition at line 541 of file bitcoinkernel.cpp.
| size_t btck_transaction_count_inputs | ( | const btck_Transaction * | transaction | ) |
Get the number of inputs of a transaction.
| [in] | transaction | Non-null. |
Definition at line 525 of file bitcoinkernel.cpp.
| size_t btck_transaction_count_outputs | ( | const btck_Transaction * | transaction | ) |
Get the number of outputs of a transaction.
| [in] | transaction | Non-null. |
Definition at line 513 of file bitcoinkernel.cpp.
| btck_Transaction * btck_transaction_create | ( | const void * | raw_transaction, |
| size_t | raw_transaction_len ) |
Create a new transaction from the serialized data.
| [in] | raw_transaction | Serialized transaction. |
| [in] | raw_transaction_len | Length of the serialized transaction. |
Definition at line 500 of file bitcoinkernel.cpp.
| void btck_transaction_destroy | ( | btck_Transaction * | transaction | ) |
Destroy the transaction.
Definition at line 557 of file bitcoinkernel.cpp.
| const btck_TransactionInput * btck_transaction_get_input_at | ( | const btck_Transaction * | transaction, |
| size_t | input_index ) |
Get the transaction input at the provided index.
The returned transaction input is not owned and depends on the lifetime of the transaction.
| [in] | transaction | Non-null. |
| [in] | input_index | The index of the transaction input to be retrieved. |
Definition at line 530 of file bitcoinkernel.cpp.
| const btck_TransactionOutput * btck_transaction_get_output_at | ( | const btck_Transaction * | transaction, |
| size_t | output_index ) |
Get the transaction outputs at the provided index.
The returned transaction output is not owned and depends on the lifetime of the transaction.
| [in] | transaction | Non-null. |
| [in] | output_index | The index of the transaction output to be retrieved. |
Definition at line 518 of file bitcoinkernel.cpp.
| const btck_Txid * btck_transaction_get_txid | ( | const btck_Transaction * | transaction | ) |
Get the txid of a transaction.
The returned txid is not owned and depends on the lifetime of the transaction.
| [in] | transaction | Non-null. |
Definition at line 536 of file bitcoinkernel.cpp.
| btck_TransactionInput * btck_transaction_input_copy | ( | const btck_TransactionInput * | transaction_input | ) |
Copy a transaction input.
| [in] | transaction_input | Non-null. |
Definition at line 685 of file bitcoinkernel.cpp.
| void btck_transaction_input_destroy | ( | btck_TransactionInput * | input | ) |
Destroy the transaction input.
Definition at line 695 of file bitcoinkernel.cpp.
| const btck_TransactionOutPoint * btck_transaction_input_get_out_point | ( | const btck_TransactionInput * | transaction_input | ) |
Get the transaction out point.
The returned transaction out point is not owned and depends on the lifetime of the transaction.
| [in] | transaction_input | Non-null. |
Definition at line 690 of file bitcoinkernel.cpp.
| btck_TransactionOutPoint * btck_transaction_out_point_copy | ( | const btck_TransactionOutPoint * | transaction_out_point | ) |
Copy a transaction out point.
| [in] | transaction_out_point | Non-null. |
Definition at line 700 of file bitcoinkernel.cpp.
| void btck_transaction_out_point_destroy | ( | btck_TransactionOutPoint * | out_point | ) |
Destroy the transaction out point.
Definition at line 715 of file bitcoinkernel.cpp.
| uint32_t btck_transaction_out_point_get_index | ( | const btck_TransactionOutPoint * | transaction_out_point | ) |
Get the output position from the transaction out point.
| [in] | transaction_out_point | Non-null. |
Definition at line 705 of file bitcoinkernel.cpp.
| const btck_Txid * btck_transaction_out_point_get_txid | ( | const btck_TransactionOutPoint * | transaction_out_point | ) |
Get the txid from the transaction out point.
The returned txid is not owned and depends on the lifetime of the transaction out point.
| [in] | transaction_out_point | Non-null. |
Definition at line 710 of file bitcoinkernel.cpp.
| btck_TransactionOutput * btck_transaction_output_copy | ( | const btck_TransactionOutput * | transaction_output | ) |
Copy a transaction output.
| [in] | transaction_output | Non-null. |
Definition at line 592 of file bitcoinkernel.cpp.
| btck_TransactionOutput * btck_transaction_output_create | ( | const btck_ScriptPubkey * | script_pubkey, |
| int64_t | amount ) |
Create a transaction output from a script pubkey and an amount.
| [in] | script_pubkey | Non-null. |
| [in] | amount | The amount associated with the script pubkey for this output. |
Definition at line 587 of file bitcoinkernel.cpp.
| void btck_transaction_output_destroy | ( | btck_TransactionOutput * | output | ) |
Destroy the transaction output.
Definition at line 607 of file bitcoinkernel.cpp.
| int64_t btck_transaction_output_get_amount | ( | const btck_TransactionOutput * | transaction_output | ) |
Get the amount in the output.
| [in] | transaction_output | Non-null. |
Definition at line 602 of file bitcoinkernel.cpp.
| const btck_ScriptPubkey * btck_transaction_output_get_script_pubkey | ( | const btck_TransactionOutput * | transaction_output | ) |
Get the script pubkey of the output.
The returned script pubkey is not owned and depends on the lifetime of the transaction output.
| [in] | transaction_output | Non-null. |
Definition at line 597 of file bitcoinkernel.cpp.
| btck_TransactionSpentOutputs * btck_transaction_spent_outputs_copy | ( | const btck_TransactionSpentOutputs * | transaction_spent_outputs | ) |
Copy a transaction's spent outputs.
| [in] | transaction_spent_outputs | Non-null. |
Definition at line 1241 of file bitcoinkernel.cpp.
| size_t btck_transaction_spent_outputs_count | ( | const btck_TransactionSpentOutputs * | transaction_spent_outputs | ) |
Returns the number of previous transaction outputs contained in the transaction spent outputs data.
| [in] | transaction_spent_outputs | Non-null |
Definition at line 1246 of file bitcoinkernel.cpp.
| void btck_transaction_spent_outputs_destroy | ( | btck_TransactionSpentOutputs * | transaction_spent_outputs | ) |
Destroy the transaction spent outputs.
Definition at line 1251 of file bitcoinkernel.cpp.
| const btck_Coin * btck_transaction_spent_outputs_get_coin_at | ( | const btck_TransactionSpentOutputs * | transaction_spent_outputs, |
| size_t | coin_index ) |
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.
| [in] | transaction_spent_outputs | Non-null. |
| [in] | coin_index | The index of the to be retrieved coin within the transaction spent outputs. |
Definition at line 1256 of file bitcoinkernel.cpp.
| int btck_transaction_to_bytes | ( | const btck_Transaction * | transaction, |
| btck_WriteBytes | writer, | ||
| void * | user_data ) |
Definition at line 546 of file bitcoinkernel.cpp.
Copy a txid.
| [in] | txid | Non-null. |
Definition at line 720 of file bitcoinkernel.cpp.
Destroy the txid.
Definition at line 735 of file bitcoinkernel.cpp.
Definition at line 730 of file bitcoinkernel.cpp.
|
static |
Definition at line 60 of file bitcoinkernel.cpp.
|
extern |
Definition at line 53 of file bitcoin-cli.cpp.