mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Rangeproof commits to scriptpubkey
This commit is contained in:
parent
74cb1f5cab
commit
714e8fc0d0
4 changed files with 9 additions and 8 deletions
|
|
@ -574,10 +574,11 @@ class CRangeCheck : public CCheck
|
|||
private:
|
||||
const CTxOutValue* val;
|
||||
const CTxOutAsset* asset;
|
||||
const CScript* scriptPubKey;
|
||||
const bool store;
|
||||
|
||||
public:
|
||||
CRangeCheck(const CTxOutValue* val_, const CTxOutAsset* asset_, const bool storeIn) : val(val_), asset(asset_), store(storeIn) {}
|
||||
CRangeCheck(const CTxOutValue* val_, const CTxOutAsset* asset_, const CScript* scriptPubKey_, const bool storeIn) : val(val_), asset(asset_), scriptPubKey(scriptPubKey_), store(storeIn) {}
|
||||
|
||||
bool operator()();
|
||||
};
|
||||
|
|
@ -632,7 +633,7 @@ bool CRangeCheck::operator()()
|
|||
return true;
|
||||
}
|
||||
|
||||
return CachingRangeProofChecker(store).VerifyRangeProof(val->vchRangeproof, val->vchCommitment, asset->vchAssetTag, secp256k1_ctx_verify_amounts);
|
||||
return CachingRangeProofChecker(store).VerifyRangeProof(val->vchRangeproof, val->vchCommitment, asset->vchAssetTag, *scriptPubKey, secp256k1_ctx_verify_amounts);
|
||||
};
|
||||
|
||||
bool CBalanceCheck::operator()()
|
||||
|
|
@ -774,7 +775,7 @@ bool VerifyAmounts(const CCoinsViewCache& cache, const CTransaction& tx, std::ve
|
|||
const CTxOutValue& val = tx.vout[i].nValue;
|
||||
if (val.IsAmount())
|
||||
continue;
|
||||
if (!QueueCheck(pvChecks, new CRangeCheck(&val, &tx.vout[i].nAsset, cacheStore))) {
|
||||
if (!QueueCheck(pvChecks, new CRangeCheck(&val, &tx.vout[i].nAsset, &tx.vout[i].scriptPubKey, cacheStore))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue