mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Consensus: Add asset type to CTxOut and validation
This commit is contained in:
parent
926851d823
commit
f9fd37cc8e
19 changed files with 198 additions and 92 deletions
|
|
@ -128,7 +128,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 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 secp256k1_context* secp256k1_ctx_verify_amounts) const
|
||||
{
|
||||
CPubKey pubkey(vchCommitment);
|
||||
uint256 entry;
|
||||
|
|
@ -142,7 +142,12 @@ bool CachingRangeProofChecker::VerifyRangeProof(const std::vector<unsigned char>
|
|||
secp256k1_pedersen_commitment commit;
|
||||
if (secp256k1_pedersen_commitment_parse(secp256k1_ctx_verify_amounts, &commit, &vchCommitment[0]) != 1)
|
||||
return false;
|
||||
if (!secp256k1_rangeproof_verify(secp256k1_ctx_verify_amounts, &min_value, &max_value, &commit, vchRangeProof.data(), vchRangeProof.size(), NULL, 0, secp256k1_generator_h)) {
|
||||
|
||||
secp256k1_generator tag;
|
||||
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)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue