We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bcc72cc commit 51ea44fCopy full SHA for 51ea44f
src/wallet/wallet.cpp
@@ -2263,7 +2263,9 @@ bool CWallet::SignTransaction(CMutableTransaction &tx)
2263
int nIn = 0;
2264
for (auto& input : tx.vin) {
2265
std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(input.prevout.hash);
2266
- assert(mi != mapWallet.end() && input.prevout.n < mi->second.tx->vout.size());
+ if(mi == mapWallet.end() || input.prevout.n >= mi->second.tx->vout.size()) {
2267
+ return false;
2268
+ }
2269
const CScript& scriptPubKey = mi->second.tx->vout[input.prevout.n].scriptPubKey;
2270
const CAmount& amount = mi->second.tx->vout[input.prevout.n].nValue;
2271
SignatureData sigdata;
0 commit comments