aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoin-tx.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-10-12 23:49:44 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-10-12 23:55:50 +0200
commit470c730e3fa9d1120dda1de2d433304023c8aa78 (patch)
tree157f390d230eb95f1a85c02d2154afa5de02d277 /src/bitcoin-tx.cpp
parentf74459dba6de4d4462860318f6ee5bda8522e07b (diff)
parent76fed838f381a6efba175f3650ec7e9dc73016d3 (diff)
downloadbitcoin-470c730e3fa9d1120dda1de2d433304023c8aa78.tar.xz
Merge #10898: Fix invalid checks (NULL checks after dereference, redundant checks, etc.)
76fed83 Avoid NULL pointer dereference when _walletModel is NULL (which is valid) (practicalswift) 4971a9a Use two boolean literals instead of re-using variable (practicalswift) b5fb339 Remove duplicate uriParts.size() > 0 check (practicalswift) 7466991 Remove redundant check (!ecc is always true) (practicalswift) 55224af Remove redundant NULL checks after new (practicalswift) Pull request description: Contains: * Remove redundant `NULL` checks after throwing `new` * Remove redundant check (`!ecc` is always true) * Remove duplicate `uriParts.size() > 0` check * Use two boolean literals instead of re-using variable Tree-SHA512: 30e9af8a9d5c8184836f8267b492aeb4e26eca171a3be08f634b3f39b3055b9fa9f06623f6c69b294ca13bf99743f7645cfac2b25e014ff74687bd085a997895
Diffstat (limited to 'src/bitcoin-tx.cpp')
-rw-r--r--src/bitcoin-tx.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp
index e4f44435ba..a20222d05c 100644
--- a/src/bitcoin-tx.cpp
+++ b/src/bitcoin-tx.cpp
@@ -690,10 +690,10 @@ static void MutateTx(CMutableTransaction& tx, const std::string& command,
else if (command == "outaddr")
MutateTxAddOutAddr(tx, commandVal);
else if (command == "outpubkey") {
- if (!ecc) { ecc.reset(new Secp256k1Init()); }
+ ecc.reset(new Secp256k1Init());
MutateTxAddOutPubKey(tx, commandVal);
} else if (command == "outmultisig") {
- if (!ecc) { ecc.reset(new Secp256k1Init()); }
+ ecc.reset(new Secp256k1Init());
MutateTxAddOutMultiSig(tx, commandVal);
} else if (command == "outscript")
MutateTxAddOutScript(tx, commandVal);
@@ -701,7 +701,7 @@ static void MutateTx(CMutableTransaction& tx, const std::string& command,
MutateTxAddOutData(tx, commandVal);
else if (command == "sign") {
- if (!ecc) { ecc.reset(new Secp256k1Init()); }
+ ecc.reset(new Secp256k1Init());
MutateTxSign(tx, commandVal);
}