Move a quick check earlier in transaction validation
This commit is contained in:
parent
b77f41419e
commit
f8dc989e99
|
@ -155,13 +155,14 @@ where
|
||||||
// We finish by waiting on these below.
|
// We finish by waiting on these below.
|
||||||
let mut async_checks = FuturesUnordered::new();
|
let mut async_checks = FuturesUnordered::new();
|
||||||
|
|
||||||
|
// Do basic checks first
|
||||||
|
check::has_inputs_and_outputs(&tx)?;
|
||||||
|
|
||||||
// Handle transparent inputs and outputs.
|
// Handle transparent inputs and outputs.
|
||||||
if tx.is_coinbase() {
|
if tx.is_coinbase() {
|
||||||
check::coinbase_tx_no_joinsplit_or_spend(&tx)?;
|
check::coinbase_tx_no_joinsplit_or_spend(&tx)?;
|
||||||
} else {
|
} else {
|
||||||
// TODO: check no coinbase inputs
|
// feed all of the inputs to the script and shielded verifiers
|
||||||
|
|
||||||
// feed all of the inputs to the script verifier
|
|
||||||
let cached_ffi_transaction =
|
let cached_ffi_transaction =
|
||||||
Arc::new(CachedFfiTransaction::new(tx.clone()));
|
Arc::new(CachedFfiTransaction::new(tx.clone()));
|
||||||
|
|
||||||
|
@ -177,8 +178,6 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
check::has_inputs_and_outputs(&tx)?;
|
|
||||||
|
|
||||||
// TODO: rework this code #1377
|
// TODO: rework this code #1377
|
||||||
let sighash = tx.sighash(
|
let sighash = tx.sighash(
|
||||||
upgrade,
|
upgrade,
|
||||||
|
|
Loading…
Reference in New Issue