diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index 4e40d48463..17d1177d01 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -63,6 +63,11 @@ public: CSHA256().Write(nonce.begin(), 32).Write(hash.begin(), 32).Write(&pubkey[0], pubkey.size()).Write(&vchSig[0], vchSig.size()).Write(&vchCommitment[0], vchCommitment.size()).Write(&scriptPubKey[0], scriptPubKey.size()).Finalize(entry.begin()); } + void ComputeEntry(uint256& entry, const std::vector& proof, const std::vector& commitment) + { + CSHA256().Write(nonce.begin(), nonce.size()).Write(proof.data(), proof.size()).Write(commitment.data(), commitment.size()).Finalize(entry.begin()); + } + bool Get(const uint256& entry, const bool erase) { @@ -145,9 +150,8 @@ bool CachingTransactionSignatureChecker::VerifySignature(const std::vector& vchRangeProof, const std::vector& vchValueCommitment, const std::vector& vchAssetCommitment, const CScript& scriptPubKey, const secp256k1_context* secp256k1_ctx_verify_amounts) const { - CPubKey pubkey(vchValueCommitment); uint256 entry; - rangeProofCache.ComputeEntry(entry, uint256(), vchRangeProof, pubkey, vchAssetCommitment, scriptPubKey); + rangeProofCache.ComputeEntry(entry, vchRangeProof, vchValueCommitment); if (rangeProofCache.Get(entry, !store)) { return true;