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§
- Full
Verification - Full transaction verification.
- Prep
Transactions - The preparation phase of transaction verification.
- Semantic
Verification - Semantic transaction verification.
- Verification
Wanted - The step where the type of verification is decided.
Functions§
- new_
tx_ verification_ data - Creates a new
TransactionVerificationData
from aTransaction
. - start_
tx_ verification - Start the transaction verification process.