aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-11-04 08:32:09 -0500
committerMarcoFalke <falke.marco@gmail.com>2019-11-04 08:32:22 -0500
commitfba574c908bb61eff1a0e83c935f3526ba9035f2 (patch)
treedfc8c14d1d42f661e9fd492982573730a289a920 /src
parentdef69e5a8632987765b409d5fdd5044250a631f1 (diff)
parentfa8919889f3c1bd3e2700ecbb56493e3cd1e25ad (diff)
downloadbitcoin-fba574c908bb61eff1a0e83c935f3526ba9035f2.tar.xz
Merge #17349: Remove redundant copy constructors
fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad bench: Remove redundant copy constructor in mempool_stress (MarcoFalke) 29f84343681831baf02a17d3af566c5c57ecf3c2 refactor: Remove redundant PSBT copy constructor (Hennadii Stepanov) Pull request description: I fail to see why people add these copy constructors manually without explanation, when the compiler can generate them at least as good automatically with less code. ACKs for top commit: promag: ACK fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad. hebasto: ACK fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad, nit s/constructor/operator/ in commit fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad message, as @promag [mentioned](https://github.com/bitcoin/bitcoin/pull/17349#discussion_r341776389) above. jonatack: ACK fa8919889f3c1bd3e2700ecbb56493e3cd1e25ad Tree-SHA512: ce024fdb894328f41037420b881169b8b1b48c87fbae5f432edf371a35c82e77e21468ef97cda6f54d34f1cf9bb010235d62904bb0669793457ed1c3b2a89723
Diffstat (limited to 'src')
-rw-r--r--src/bench/mempool_stress.cpp8
-rw-r--r--src/psbt.h1
2 files changed, 1 insertions, 8 deletions
diff --git a/src/bench/mempool_stress.cpp b/src/bench/mempool_stress.cpp
index a42ffaae62..389e2c096f 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();
}
diff --git a/src/psbt.h b/src/psbt.h
index 9d996171bb..6a5c468058 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