From f8dc989e99c7987a0509db0a5eee7120e8921019 Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 25 Mar 2021 11:10:29 +1000 Subject: [PATCH] Move a quick check earlier in transaction validation --- zebra-consensus/src/transaction.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/zebra-consensus/src/transaction.rs b/zebra-consensus/src/transaction.rs index 517c299a4..c615772ca 100644 --- a/zebra-consensus/src/transaction.rs +++ b/zebra-consensus/src/transaction.rs @@ -155,13 +155,14 @@ where // We finish by waiting on these below. let mut async_checks = FuturesUnordered::new(); + // Do basic checks first + check::has_inputs_and_outputs(&tx)?; + // Handle transparent inputs and outputs. if tx.is_coinbase() { check::coinbase_tx_no_joinsplit_or_spend(&tx)?; } else { - // TODO: check no coinbase inputs - - // feed all of the inputs to the script verifier + // feed all of the inputs to the script and shielded verifiers let cached_ffi_transaction = Arc::new(CachedFfiTransaction::new(tx.clone())); @@ -177,8 +178,6 @@ where } } - check::has_inputs_and_outputs(&tx)?; - // TODO: rework this code #1377 let sighash = tx.sighash( upgrade,