Module block

Source
Expand description

Shared block, header, and transaction reading code.

In the functions in this module:

The block write task commits blocks to the finalized state before updating chain or non_finalized_state with a cached copy of the non-finalized chains in NonFinalizedState.chain_set. Then the block commit task can commit additional blocks to the finalized state after we’ve cloned the chain or non_finalized_state.

This means that some blocks can be in both:

Functions§

any_utxo
Returns the Utxo for transparent::OutPoint, if it exists in any chain in the non_finalized_state, or in the finalized db.
block
Returns the Block with block::Hash or Height, if it exists in the non-finalized chain or finalized db.
block_and_size
Returns the Block with block::Hash or Height, if it exists in the non-finalized chain or finalized db.
block_header
Returns the block::Header with block::Hash or Height, if it exists in the non-finalized chain or finalized db.
block_info
Returns the BlockInfo with block::Hash or Height, if it exists in the non-finalized chain or finalized db.
mined_transaction
Returns a MinedTx for a Transaction with transaction::Hash, if one exists in the non-finalized chain or finalized db.
spending_transaction_hash
Returns the Hash of the transaction that spent an output at the provided transparent::OutPoint or revealed the provided nullifier, if it exists and is spent or revealed in the non-finalized chain or finalized db and its spending transaction hash has been indexed.
transaction 🔒
Returns the Transaction with transaction::Hash, if it exists in the non-finalized chain or finalized db.
transaction_hashes_for_block
Returns the transaction::Hashes for the block with hash_or_height, if it exists in the non-finalized chain or finalized db.
unspent_utxo
Returns the Utxo for transparent::OutPoint, if it exists and is unspent in the non-finalized chain or finalized db.
utxo
Returns the Utxo for transparent::OutPoint, if it exists in the non-finalized chain or finalized db.