pub fn spend_conflicts(transaction: &Transaction) -> Result<(), TransactionError> {
    use crate::error::TransactionError::*;

    let transparent_outpoints = transaction.spent_outpoints().map(Cow::Owned);
    let sprout_nullifiers = transaction.sprout_nullifiers().map(Cow::Borrowed);
    let sapling_nullifiers = transaction.sapling_nullifiers().map(Cow::Borrowed);
    let orchard_nullifiers = transaction.orchard_nullifiers().map(Cow::Borrowed);

    check_for_duplicates(transparent_outpoints, DuplicateTransparentSpend)?;
    check_for_duplicates(sprout_nullifiers, DuplicateSproutNullifier)?;
    check_for_duplicates(sapling_nullifiers, DuplicateSaplingNullifier)?;
    check_for_duplicates(orchard_nullifiers, DuplicateOrchardNullifier)?;

    Ok(())
}
/// Check if a transaction has any internal spend conflicts.
///
/// An internal spend conflict happens if the transaction spends a UTXO more than once or if it
/// reveals a nullifier more than once.
///
/// Consensus rules:
///
/// "each output of a particular transaction
/// can only be used as an input once in the block chain.
/// Any subsequent reference is a forbidden double spend-
/// an attempt to spend the same satoshis twice."
///
/// https://developer.bitcoin.org/devguide/block_chain.html#introduction
///
/// A _nullifier_ *MUST NOT* repeat either within a _transaction_, or across _transactions_ in a
/// _valid blockchain_ . *Sprout* and *Sapling* and *Orchard* _nulliers_ are considered disjoint,
/// even if they have the same bit pattern.
///
/// https://zips.z.cash/protocol/protocol.pdf#nullifierset
Check if a transaction has any internal spend conflicts.
An internal spend conflict happens if the transaction spends a UTXO more than once or if it
reveals a nullifier more than once.

Consensus rules.

"each output of a particular transaction
can only be used as an input once in the block chain.
Any subsequent reference is a forbidden double spend
an attempt to spend the same satoshis twice."



A _nullifier_ *MUST NOT* repeat either within a _transaction_, or across _transactions_ in a
_valid blockchain_ .


Check if a transaction has any internal spend conflicts . An internal spend conflict happens if the transaction spends a UTXO more than once or if it reveals a nullifier more than once . Consensus rules . " each output of a particular transaction can only be used as an input once in the block chain . Any subsequent reference is a forbidden double spend an attempt to spend the same satoshis twice . " A _nullifier_ * MUST NOT * repeat either within a _transaction_ or across _transactions_ in a _valid blockchain_ .
pub fn spend_conflicts(transaction: &Transaction) -> Result<(), TransactionError> {
    use crate::error::TransactionError::*;
    let transparent_outpoints = transaction.spent_outpoints().map(Cow::Owned);
    let sprout_nullifiers = transaction.sprout_nullifiers().map(Cow::Borrowed);
    let sapling_nullifiers = transaction.sapling_nullifiers().map(Cow::Borrowed);
    let orchard_nullifiers = transaction.orchard_nullifiers().map(Cow::Borrowed);
    check_for_duplicates(transparent_outpoints, DuplicateTransparentSpend)?;
    check_for_duplicates(sprout_nullifiers, DuplicateSproutNullifier)?;
    check_for_duplicates(sapling_nullifiers, DuplicateSaplingNullifier)?;
    check_for_duplicates(orchard_nullifiers, DuplicateOrchardNullifier)?;
    Ok(())
}
pub fn spend_conflicts ( transaction : & Transaction ) -> Result < ( ) , TransactionError > { use crate :: error :: TransactionError :: * ; let transparent_outpoints = transaction . spent_outpoints ( ) . map ( Cow :: Owned ) ; let sprout_nullifiers = transaction . sprout_nullifiers ( ) . map ( Cow :: Borrowed ) ; let sapling_nullifiers = transaction . sapling_nullifiers ( ) . map ( Cow :: Borrowed ) ; let orchard_nullifiers = transaction . orchard_nullifiers ( ) . map ( Cow :: Borrowed ) ; check_for_duplicates ( transparent_outpoints , DuplicateTransparentSpend ) ? ; check_for_duplicates ( sprout_nullifiers , DuplicateSproutNullifier ) ? ; check_for_duplicates ( sapling_nullifiers , DuplicateSaplingNullifier ) ? ; check_for_duplicates ( orchard_nullifiers , DuplicateOrchardNullifier ) ? ; Ok ( ( ) ) }
Check if a transaction has any internal spend conflicts.
Check if a transaction has any internal spend conflicts .
transaction
&Transaction