fn verify_not_stxos<B: BlockchainBackend>(tx: &Transaction, db: &B) -> Result<(), ValidationError> {
    for input in tx.body.inputs() {
        if is_stxo(db, input.hash())? {
            // we dont want to log this as a node or wallet might retransmit a transaction
            debug!(
                target: LOG_TARGET,
                "Transaction validation failed due to already spent input: {}", input
            );
            return Err(ValidationError::ContainsSTxO);
        }
    }
    for output in tx.body.outputs() {
        if is_stxo(db, output.hash())? {
            debug!(
                target: LOG_TARGET,
                "Transaction validation failed due to previously spent output: {}", output
            );
            return Err(ValidationError::ContainsSTxO);
        }
    }
    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.
This function checks that the inputs and outputs do not exist in the STxO set .
fn verify_not_stxos<B: BlockchainBackend>(tx: &Transaction, db: &B) -> Result<(), ValidationError> {
    for input in tx.body.inputs() {
        if is_stxo(db, input.hash())? {
            // we dont want to log this as a node or wallet might retransmit a transaction
            debug!(
                target: LOG_TARGET,
                "Transaction validation failed due to already spent input: {}", input
            );
            return Err(ValidationError::ContainsSTxO);
        }
    }
    for output in tx.body.outputs() {
        if is_stxo(db, output.hash())? {
            debug!(
                target: LOG_TARGET,
                "Transaction validation failed due to previously spent output: {}", output
            );
            return Err(ValidationError::ContainsSTxO);
        }
    }
    Ok(())
}
fn verify_not_stxos < B : BlockchainBackend > ( tx : & Transaction , db : & B ) -> Result < ( ) , ValidationError > { for input in tx . body . inputs ( ) { if is_stxo ( db , input . hash ( ) ) ? { // we dont want to log this as a node or wallet might retransmit a transaction debug ! ( target LOG_TARGET " " input ) ; return Err ( ValidationError :: ContainsSTxO ) ; } } for output in tx . body . outputs ( ) { if is_stxo ( db , output . hash ( ) ) ? { debug ! ( target LOG_TARGET " " output ) ; return Err ( ValidationError :: ContainsSTxO ) ; } } 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 .
tx
&Transaction
db
&B
tx
&Transaction
db
&B