pub fn verify_syntax(&self) -> TransactionResult<()> {

        if self.raw.len() > MAX_TRANSACTION_SIZE {
            return Err(TransactionError::TransactionTooLarge);
        }

        if self.txs_in.is_empty() {
            return Err(TransactionError::NoInputs);
        }

        if self.txs_out.is_empty() {
            return Err(TransactionError::NoOutputs);
        }

        // No double inputs
        if self.txs_in.iter().combinations(2).any(|pair|
               pair[0].prev_tx_out_idx == pair[1].prev_tx_out_idx
            && pair[0].prev_tx_out     == pair[1].prev_tx_out)
        {
            return Err(TransactionError::DuplicateInputs);
        }

        Ok(())
    }
/// Performs basic syntax checks on the transaction
Performs basic syntax checks on the transaction
Performs basic syntax checks on the transaction
pub fn verify_syntax(&self) -> TransactionResult<()> {
        if self.raw.len() > MAX_TRANSACTION_SIZE {
            return Err(TransactionError::TransactionTooLarge);
        }
        if self.txs_in.is_empty() {
            return Err(TransactionError::NoInputs);
        }
        if self.txs_out.is_empty() {
            return Err(TransactionError::NoOutputs);
        }
        // No double inputs
        if self.txs_in.iter().combinations(2).any(|pair|
               pair[0].prev_tx_out_idx == pair[1].prev_tx_out_idx
            && pair[0].prev_tx_out     == pair[1].prev_tx_out)
        {
            return Err(TransactionError::DuplicateInputs);
        }
        Ok(())
    }
pub fn verify_syntax ( & self ) -> TransactionResult < ( ) > { if self . raw . len ( ) > MAX_TRANSACTION_SIZE { return Err ( TransactionError :: TransactionTooLarge ) ; } if self . txs_in . is_empty ( ) { return Err ( TransactionError :: NoInputs ) ; } if self . txs_out . is_empty ( ) { return Err ( TransactionError :: NoOutputs ) ; } // No double inputs if self . txs_in . iter ( ) . combinations ( 2 ) . any ( | pair | pair [ 0 ] . prev_tx_out_idx == pair [ 1 ] . prev_tx_out_idx && pair [ 0 ] . prev_tx_out == pair [ 1 ] . prev_tx_out ) { return Err ( TransactionError :: DuplicateInputs ) ; } Ok ( ( ) ) }
Performs basic syntax checks on the transaction
Performs basic syntax checks on the transaction
&self
&self