mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
CSurjectionCheck copies vector instead of swapping
This commit is contained in:
parent
3c376534e3
commit
87c1fc29af
1 changed files with 1 additions and 8 deletions
|
|
@ -611,9 +611,7 @@ private:
|
|||
secp256k1_generator gen;
|
||||
const bool store;
|
||||
public:
|
||||
CSurjectionCheck(secp256k1_surjectionproof& proofIn, std::vector<secp256k1_generator>& vTags_, secp256k1_generator& genIn, const bool storeIn) : proof(proofIn), gen(genIn), store(storeIn) {
|
||||
vTags.swap(vTags_);
|
||||
}
|
||||
CSurjectionCheck(secp256k1_surjectionproof& proofIn, std::vector<secp256k1_generator>& tags_in, secp256k1_generator& genIn, const bool storeIn) : proof(proofIn), vTags(tags_in), gen(genIn), store(storeIn) {}
|
||||
|
||||
bool operator()();
|
||||
};
|
||||
|
|
@ -954,8 +952,6 @@ bool VerifyAmounts(const CCoinsViewCache& cache, const CTransaction& tx, std::ve
|
|||
}
|
||||
}
|
||||
|
||||
std::vector<secp256k1_generator> copy_targetGenerators(targetGenerators);
|
||||
|
||||
for (size_t i = 0; i < tx.vout.size(); i++)
|
||||
{
|
||||
const CConfidentialAsset& asset = tx.vout[i].nAsset;
|
||||
|
|
@ -979,9 +975,6 @@ bool VerifyAmounts(const CCoinsViewCache& cache, const CTransaction& tx, std::ve
|
|||
if (!QueueCheck(pvChecks, new CSurjectionCheck(proof, targetGenerators, gen, cacheStore))) {
|
||||
return false;
|
||||
}
|
||||
// Each CSurjectionCheck uses swap to keep pointers valid.
|
||||
// Original values need to put back in place for next output
|
||||
targetGenerators = copy_targetGenerators;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue