From 87c1fc29af7dbc3884ed0cd4ea8a815044d60706 Mon Sep 17 00:00:00 2001 From: Gregory Sanders Date: Tue, 18 Jul 2017 22:35:03 -0400 Subject: [PATCH] CSurjectionCheck copies vector instead of swapping --- src/validation.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/validation.cpp b/src/validation.cpp index 6e699b832f..ff3f3e0419 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -611,9 +611,7 @@ private: secp256k1_generator gen; const bool store; public: - CSurjectionCheck(secp256k1_surjectionproof& proofIn, std::vector& vTags_, secp256k1_generator& genIn, const bool storeIn) : proof(proofIn), gen(genIn), store(storeIn) { - vTags.swap(vTags_); - } + CSurjectionCheck(secp256k1_surjectionproof& proofIn, std::vector& 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 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;