aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-05-04 17:38:49 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-05-04 17:40:52 -0400
commitfaab55fbb17f2ea5080bf02bc59eeef5ca746f07 (patch)
tree6f1c03fd468c4f63ab681af33c47370cb9179b95 /src/wallet
parentf82e1c94821212cc8962775a7a29599ebd92eee0 (diff)
Make CMutableTransaction constructor explicit
Silently converting to a CMutableTransaction will drop all caches and should thus be done explicitly
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/feebumper.cpp2
-rw-r--r--src/wallet/wallet.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/wallet/feebumper.cpp b/src/wallet/feebumper.cpp
index 4d70dde72a..b26fd28d48 100644
--- a/src/wallet/feebumper.cpp
+++ b/src/wallet/feebumper.cpp
@@ -185,7 +185,7 @@ Result CreateTransaction(const CWallet* wallet, const uint256& txid, const CCoin
// If the output is not large enough to pay the fee, fail.
CAmount nDelta = new_fee - old_fee;
assert(nDelta > 0);
- mtx = *wtx.tx;
+ mtx = CMutableTransaction{*wtx.tx};
CTxOut* poutput = &(mtx.vout[nOutput]);
if (poutput->nValue < nDelta) {
errors.push_back("Change output is too small to bump the fee");
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 9533e6ff56..fb772bfc4d 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2065,8 +2065,8 @@ bool CWalletTx::IsTrusted() const
bool CWalletTx::IsEquivalentTo(const CWalletTx& _tx) const
{
- CMutableTransaction tx1 = *this->tx;
- CMutableTransaction tx2 = *_tx.tx;
+ CMutableTransaction tx1 {*this->tx};
+ CMutableTransaction tx2 {*_tx.tx};
for (auto& txin : tx1.vin) txin.scriptSig = CScript();
for (auto& txin : tx2.vin) txin.scriptSig = CScript();
return CTransaction(tx1) == CTransaction(tx2);