fn verify_transparent_inputs_and_outputs(
        request: &Request,
        network: Network,
        script_verifier: script::Verifier<ZS>,
        cached_ffi_transaction: Arc<CachedFfiTransaction>,
        utxo_sender: mpsc::UnboundedSender<script::Response>,
    ) -> Result<AsyncChecks, TransactionError> {
        let transaction = request.transaction();

        if transaction.has_valid_coinbase_transaction_inputs() {
            // The script verifier only verifies PrevOut inputs and their corresponding UTXOs.
            // Coinbase transactions don't have any PrevOut inputs.
            Ok(AsyncChecks::new())
        } else {
            // feed all of the inputs to the script verifier
            // the script_verifier also checks transparent sighashes, using its own implementation
            let inputs = transaction.inputs();
            let known_utxos = request.known_utxos();
            let upgrade = request.upgrade(network);

            let script_checks = (0..inputs.len())
                .into_iter()
                .map(move |input_index| {
                    let utxo_sender = utxo_sender.clone();

                    let request = script::Request {
                        upgrade,
                        known_utxos: known_utxos.clone(),
                        cached_ffi_transaction: cached_ffi_transaction.clone(),
                        input_index,
                    };

                    script_verifier.clone().oneshot(request).map_ok(move |rsp| {
                        utxo_sender.send(rsp).expect("receiver is not dropped");
                    })
                })
                .collect();

            Ok(script_checks)
        }
    }
/// Verifies if a transaction's transparent inputs are valid using the provided
/// `script_verifier` and `cached_ffi_transaction`.
///
/// Returns script verification responses via the `utxo_sender`.
Verifies if a transaction's transparent inputs are valid using the provided
`script_verifier` and `cached_ffi_transaction`.

Returns script verification responses via the `utxo_sender`.
Verifies if a transaction ' s transparent inputs are valid using the provided ` script_verifier ` and ` cached_ffi_transaction ` . Returns script verification responses via the ` utxo_sender ` .
fn verify_transparent_inputs_and_outputs(
        request: &Request,
        network: Network,
        script_verifier: script::Verifier<ZS>,
        cached_ffi_transaction: Arc<CachedFfiTransaction>,
        utxo_sender: mpsc::UnboundedSender<script::Response>,
    ) -> Result<AsyncChecks, TransactionError> {
        let transaction = request.transaction();
        if transaction.has_valid_coinbase_transaction_inputs() {
            // The script verifier only verifies PrevOut inputs and their corresponding UTXOs.
            // Coinbase transactions don't have any PrevOut inputs.
            Ok(AsyncChecks::new())
        } else {
            // feed all of the inputs to the script verifier
            // the script_verifier also checks transparent sighashes, using its own implementation
            let inputs = transaction.inputs();
            let known_utxos = request.known_utxos();
            let upgrade = request.upgrade(network);
            let script_checks = (0..inputs.len())
                .into_iter()
                .map(move |input_index| {
                    let utxo_sender = utxo_sender.clone();
                    let request = script::Request {
                        upgrade,
                        known_utxos: known_utxos.clone(),
                        cached_ffi_transaction: cached_ffi_transaction.clone(),
                        input_index,
                    };
                    script_verifier.clone().oneshot(request).map_ok(move |rsp| {
                        utxo_sender.send(rsp).expect("receiver is not dropped");
                    })
                })
                .collect();
            Ok(script_checks)
        }
    }
fn verify_transparent_inputs_and_outputs ( request : & Request , network : Network , script_verifier : script :: Verifier < ZS > , cached_ffi_transaction : Arc < CachedFfiTransaction > , utxo_sender : mpsc :: UnboundedSender < script :: Response > , ) -> Result < AsyncChecks , TransactionError > { let transaction = request . transaction ( ) ; if transaction . has_valid_coinbase_transaction_inputs ( ) { // The script verifier only verifies PrevOut inputs and their corresponding UTXOs. // Coinbase transactions don't have any PrevOut inputs. Ok ( AsyncChecks :: new ( ) ) } else { // feed all of the inputs to the script verifier // the script_verifier also checks transparent sighashes, using its own implementation let inputs = transaction . inputs ( ) ; let known_utxos = request . known_utxos ( ) ; let upgrade = request . upgrade ( network ) ; let script_checks = ( 0 .. inputs . len ( ) ) . into_iter ( ) . map ( move | input_index | { let utxo_sender = utxo_sender . clone ( ) ; let request = script :: Request { upgrade , known_utxos : known_utxos . clone ( ) , cached_ffi_transaction : cached_ffi_transaction . clone ( ) , input_index , } ; script_verifier . clone ( ) . oneshot ( request ) . map_ok ( move | rsp | { utxo_sender . send ( rsp ) . expect ( " " ) ; } ) } ) . collect ( ) ; Ok ( script_checks ) } }
Verifies if a transaction's transparent inputs are valid using the provided
`script_verifier` and `cached_ffi_transaction`.
Verifies if a transaction ' s transparent inputs are valid using the provided ` script_verifier ` and ` cached_ffi_transaction ` .
request
&Request
network
Network
script_verifier
script::Verifier<ZS>
cached_ffi_transaction
Arc<CachedFfiTransaction>
utxo_sender
mpsc::UnboundedSender<script::Response>