Module transactions

Source
Expand description

§Transaction Verifier Service.

This module contains the transaction validation interface, which can be accessed with start_tx_verification.

Transaction verification states will be cached to prevent doing the expensive checks multiple times.

§Example Semantic Verification

use cuprate_consensus::{transactions::start_tx_verification, HardFork, batch_verifier::MultiThreadedBatchVerifier};

let batch_verifier = MultiThreadedBatchVerifier::new(rayon::current_num_threads());

let tx = start_tx_verification()
             .append_txs(vec![tx])
             .prepare()?
             .only_semantic(HardFork::V9)
             .queue(&batch_verifier)?;

assert!(batch_verifier.verify());
Ok(())

Modules§

contextual_data
Contextual Data

Structs§

FullVerification
Full transaction verification.
PrepTransactions
The preparation phase of transaction verification.
SemanticVerification
Semantic transaction verification.
VerificationWanted
The step where the type of verification is decided.

Functions§

new_tx_verification_data
Creates a new TransactionVerificationData from a Transaction.
start_tx_verification
Start the transaction verification process.