Use "return false" instead assert() in CWallet::SignTransaction
This commit is contained in:
parent
bcc72cccc7
commit
51ea44f01c
1 changed files with 3 additions and 1 deletions
|
@ -2263,7 +2263,9 @@ bool CWallet::SignTransaction(CMutableTransaction &tx)
|
||||||
int nIn = 0;
|
int nIn = 0;
|
||||||
for (auto& input : tx.vin) {
|
for (auto& input : tx.vin) {
|
||||||
std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(input.prevout.hash);
|
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 CScript& scriptPubKey = mi->second.tx->vout[input.prevout.n].scriptPubKey;
|
||||||
const CAmount& amount = mi->second.tx->vout[input.prevout.n].nValue;
|
const CAmount& amount = mi->second.tx->vout[input.prevout.n].nValue;
|
||||||
SignatureData sigdata;
|
SignatureData sigdata;
|
||||||
|
|
Loading…
Reference in a new issue