Skip to main content

cuprate_txpool/
free.rs

1//! General free functions (related to the tx-pool database).
2
3use crate::types::TransactionBlobHash;
4
5/// Calculate the transaction blob hash.
6///
7/// This value is supposed to be quick to compute just based of the tx-blob without needing to parse the tx.
8///
9/// The exact way the hash is calculated is not stable and is subject to change, as such it should not be exposed
10/// as a way to interact with Cuprate externally.
11pub fn transaction_blob_hash(tx_blob: &[u8]) -> TransactionBlobHash {
12    blake3::hash(tx_blob).into()
13}