aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2018-04-17 13:25:34 -0400
committerMarcoFalke <[email protected]>2018-04-17 13:28:12 -0400
commit6b46288a0853621bc911c26bb87bba22521059e7 (patch)
tree279c5ade6cebcfd997a480a072d860485dece10c /src/bench
parentMerge #12982: Fix inconsistent namespace formatting guidelines (diff)
parenttests: Avoid copies of CTransaction (diff)
downloaddiscoin-6b46288a0853621bc911c26bb87bba22521059e7.tar.xz
discoin-6b46288a0853621bc911c26bb87bba22521059e7.zip
Merge #12949: tests: Avoid copies of CTransaction
fae58eca93 tests: Avoid copies of CTransaction (MarcoFalke) Pull request description: Avoid the copy (or move) constructor of `CTransaction` in test code, whereever a simple reference can be used instead. Tree-SHA512: 8ef2077a277d6182996f4671722fdc01a90909ae7431c1e52604aab8ed028910615028caf9b4cb07a9b15fdc04939dea2209cc3189dde7d38271256d9fe1076c
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/mempool_eviction.cpp2
-rw-r--r--src/bench/verify_script.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/bench/mempool_eviction.cpp b/src/bench/mempool_eviction.cpp
index cdda0bd9b..e05a5e3d1 100644
--- a/src/bench/mempool_eviction.cpp
+++ b/src/bench/mempool_eviction.cpp
@@ -9,7 +9,7 @@
#include <list>
#include <vector>
-static void AddTx(const CTransaction& tx, const CAmount& nFee, CTxMemPool& pool)
+static void AddTx(const CMutableTransaction& tx, const CAmount& nFee, CTxMemPool& pool)
{
int64_t nTime = 0;
unsigned int nHeight = 1;
diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp
index 705fa368a..4100519d4 100644
--- a/src/bench/verify_script.cpp
+++ b/src/bench/verify_script.cpp
@@ -71,7 +71,7 @@ static void VerifyScriptBench(benchmark::State& state)
CScript scriptPubKey = CScript() << witnessversion << ToByteVector(pubkeyHash);
CScript scriptSig;
CScript witScriptPubkey = CScript() << OP_DUP << OP_HASH160 << ToByteVector(pubkeyHash) << OP_EQUALVERIFY << OP_CHECKSIG;
- CTransaction txCredit = BuildCreditingTransaction(scriptPubKey);
+ const CMutableTransaction& txCredit = BuildCreditingTransaction(scriptPubKey);
CMutableTransaction txSpend = BuildSpendingTransaction(scriptSig, txCredit);
CScriptWitness& witness = txSpend.vin[0].scriptWitness;
witness.stack.emplace_back();