Rangeproof commits to scriptpubkey

This commit is contained in:
Gregory Sanders 2017-02-09 11:35:00 -05:00
parent 74cb1f5cab
commit 714e8fc0d0
4 changed files with 9 additions and 8 deletions

View file

@ -143,7 +143,7 @@ bool CachingTransactionSignatureChecker::VerifySignature(const std::vector<unsig
return true;
}
bool CachingRangeProofChecker::VerifyRangeProof(const std::vector<unsigned char>& vchRangeProof, const std::vector<unsigned char>& vchCommitment, const std::vector<unsigned char>& vchAssetTag, const secp256k1_context* secp256k1_ctx_verify_amounts) const
bool CachingRangeProofChecker::VerifyRangeProof(const std::vector<unsigned char>& vchRangeProof, const std::vector<unsigned char>& vchCommitment, const std::vector<unsigned char>& vchAssetTag, const CScript& scriptPubKey, const secp256k1_context* secp256k1_ctx_verify_amounts) const
{
CPubKey pubkey(vchCommitment);
uint256 entry;
@ -162,7 +162,7 @@ bool CachingRangeProofChecker::VerifyRangeProof(const std::vector<unsigned char>
if (secp256k1_generator_parse(secp256k1_ctx_verify_amounts, &tag, &vchAssetTag[0]) != 1)
return false;
if (!secp256k1_rangeproof_verify(secp256k1_ctx_verify_amounts, &min_value, &max_value, &commit, vchRangeProof.data(), vchRangeProof.size(), NULL, 0, &tag)) {
if (!secp256k1_rangeproof_verify(secp256k1_ctx_verify_amounts, &min_value, &max_value, &commit, vchRangeProof.data(), vchRangeProof.size(), scriptPubKey.size() ? &scriptPubKey.front() : NULL, scriptPubKey.size(), &tag)) {
return false;
}