From 29f84343681831baf02a17d3af566c5c57ecf3c2 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Sat, 17 Aug 2019 17:28:43 +0300 Subject: [PATCH 1/2] refactor: Remove redundant PSBT copy constructor The default (i.e., generated by a compiler) copy constructor does the same things. Also this prevents -Wdeprecated-copy warning for implicitly declared operator= in GCC 9. --- src/psbt.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/psbt.h b/src/psbt.h index 9d996171bb7..6a5c468058a 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -401,7 +401,6 @@ struct PartiallySignedTransaction bool AddInput(const CTxIn& txin, PSBTInput& psbtin); bool AddOutput(const CTxOut& txout, const PSBTOutput& psbtout); PartiallySignedTransaction() {} - PartiallySignedTransaction(const PartiallySignedTransaction& psbt_in) : tx(psbt_in.tx), inputs(psbt_in.inputs), outputs(psbt_in.outputs), unknown(psbt_in.unknown) {} explicit PartiallySignedTransaction(const CMutableTransaction& tx); /** * Finds the UTXO for a given input index From fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad Mon Sep 17 00:00:00 2001 From: MarcoFalke Date: Fri, 1 Nov 2019 18:20:04 -0400 Subject: [PATCH 2/2] bench: Remove redundant copy constructor in mempool_stress --- src/bench/mempool_stress.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/bench/mempool_stress.cpp b/src/bench/mempool_stress.cpp index a42ffaae62e..389e2c096f2 100644 --- a/src/bench/mempool_stress.cpp +++ b/src/bench/mempool_stress.cpp @@ -23,12 +23,6 @@ struct Available { size_t vin_left{0}; size_t tx_count; Available(CTransactionRef& ref, size_t tx_count) : ref(ref), tx_count(tx_count){} - Available& operator=(Available other) { - ref = other.ref; - vin_left = other.vin_left; - tx_count = other.tx_count; - return *this; - } }; static void ComplexMemPool(benchmark::State& state) @@ -66,7 +60,7 @@ static void ComplexMemPool(benchmark::State& state) tx.vin.back().scriptSig = CScript() << coin.tx_count; tx.vin.back().scriptWitness.stack.push_back(CScriptNum(coin.tx_count).getvch()); } - if (coin.vin_left == coin.ref->vin.size()) { + if (coin.vin_left == coin.ref->vin.size()) { coin = available_coins.back(); available_coins.pop_back(); }