From e4f58f018ac9af2f6426dca1bae1f57cea7ce76e Mon Sep 17 00:00:00 2001 From: teor Date: Thu, 25 Mar 2021 11:12:02 +1000 Subject: [PATCH] Re-enable joinsplit and sapling spend auth verification --- zebra-consensus/src/transaction.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/zebra-consensus/src/transaction.rs b/zebra-consensus/src/transaction.rs index c615772c..22ab8b9d 100644 --- a/zebra-consensus/src/transaction.rs +++ b/zebra-consensus/src/transaction.rs @@ -178,11 +178,10 @@ where } } - // TODO: rework this code #1377 - let sighash = tx.sighash( + let shielded_sighash = tx.sighash( upgrade, - HashType::ALL, // TODO: check these - None, // TODO: check these + HashType::ALL, + None, ); if let Some(joinsplit_data) = joinsplit_data { @@ -192,9 +191,7 @@ where // correctly. // Then, pass those items to self.joinsplit to verify them. - - // Ignore pending sighash check #1377 - let _ = check::validate_joinsplit_sig(joinsplit_data, sighash.as_bytes()); + check::validate_joinsplit_sig(joinsplit_data, shielded_sighash.as_bytes())?; } if let Some(shielded_data) = shielded_data { @@ -233,13 +230,12 @@ where // description while adding the resulting future to // our collection of async checks that (at a // minimum) must pass for the transaction to verify. - let _rsp = redjubjub_verifier + let rsp = redjubjub_verifier .ready_and() .await? - .call((spend.rk, spend.spend_auth_sig, &sighash).into()); + .call((spend.rk, spend.spend_auth_sig, &shielded_sighash).into()); - // Disable pending sighash check #1377 - // async_checks.push(rsp.boxed()); + async_checks.push(rsp.boxed()); } for output in shielded_data.outputs() {