aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2017-03-27 14:00:14 +0200
committerJonas Schnelli <dev@jonasschnelli.ch>2017-04-02 10:12:43 +0200
commit51ea44f01c0d63aeacb8657b6305040b3419e9f1 (patch)
treede330dbfca90469a863288cfee9670ad9e7de4da /src/wallet
parentbcc72cccc72f020d6896bbbf4e85df11e1d5a4f0 (diff)
downloadbitcoin-51ea44f01c0d63aeacb8657b6305040b3419e9f1.tar.xz
Use "return false" instead assert() in CWallet::SignTransaction
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/wallet.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 186d3c5cd3..d415bb09c6 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2263,7 +2263,9 @@ bool CWallet::SignTransaction(CMutableTransaction &tx)
int nIn = 0;
for (auto& input : tx.vin) {
std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(input.prevout.hash);
- assert(mi != mapWallet.end() && input.prevout.n < mi->second.tx->vout.size());
+ if(mi == mapWallet.end() || input.prevout.n >= mi->second.tx->vout.size()) {
+ return false;
+ }
const CScript& scriptPubKey = mi->second.tx->vout[input.prevout.n].scriptPubKey;
const CAmount& amount = mi->second.tx->vout[input.prevout.n].nValue;
SignatureData sigdata;