diff --git a/src/zcash/JoinSplit.cpp b/src/zcash/JoinSplit.cpp index 0d9e789d7..3eb30a4f3 100644 --- a/src/zcash/JoinSplit.cpp +++ b/src/zcash/JoinSplit.cpp @@ -139,25 +139,25 @@ public: throw std::runtime_error("JoinSplit verifying key not loaded"); } - r1cs_ppzksnark_proof r1cs_proof; - std::stringstream ss; - std::string proof_str(proof.begin(), proof.end()); - ss.str(proof_str); - ss >> r1cs_proof; - - uint256 h_sig = this->h_sig(randomSeed, nullifiers, pubKeyHash); - - auto witness = joinsplit_gadget::witness_map( - rt, - h_sig, - macs, - nullifiers, - commitments, - vpub_old, - vpub_new - ); - try { + r1cs_ppzksnark_proof r1cs_proof; + std::stringstream ss; + std::string proof_str(proof.begin(), proof.end()); + ss.str(proof_str); + ss >> r1cs_proof; + + uint256 h_sig = this->h_sig(randomSeed, nullifiers, pubKeyHash); + + auto witness = joinsplit_gadget::witness_map( + rt, + h_sig, + macs, + nullifiers, + commitments, + vpub_old, + vpub_new + ); + return r1cs_ppzksnark_verifier_strong_IC(*vk, witness, r1cs_proof); } catch (...) { return false;