Browse Source

Use "return false" instead assert() in CWallet::SignTransaction

0.15
Jonas Schnelli 8 years ago
parent
commit
51ea44f01c
No known key found for this signature in database
GPG Key ID: 1EB776BB03C7922D
  1. 4
      src/wallet/wallet.cpp

4
src/wallet/wallet.cpp

@ -2263,7 +2263,9 @@ bool CWallet::SignTransaction(CMutableTransaction &tx) @@ -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;

Loading…
Cancel
Save