// This function checks that the inputs and outputs do not exist in the STxO set.
This function checks that the inputs and outputs do not exist in the STxO set.
This function checks that the inputs and outputs do not exist in the STxO set .
fn check_not_duplicate_txos<B: BlockchainBackend>(transaction: &Transaction, db: &B) -> Result<(), ValidationError> {
    for output in transaction.body.outputs() {
        if db.fetch_mmr_leaf_index(MmrTree::Utxo, &output.hash())?.is_some() {
            warn!(
                target: LOG_TARGET,
                "Transaction validation failed due to previously spent output: {}", output
            );
            return Err(ValidationError::ContainsTxO);
        }
    }
    Ok(())
}
fn check_not_duplicate_txos < B : BlockchainBackend > ( transaction : & Transaction , db : & B ) -> Result < ( ) , ValidationError > { for output in transaction . body . outputs ( ) { if db . fetch_mmr_leaf_index ( MmrTree :: Utxo , & output . hash ( ) ) ? . is_some ( ) { warn ! ( target LOG_TARGET " " output ) ; return Err ( ValidationError :: ContainsTxO ) ; } } Ok ( ( ) ) }
This function checks that the inputs and outputs do not exist in the STxO set.
This function checks that the inputs and outputs do not exist in the STxO set .
transaction
&Transaction
db
&B