Skip to content

Commit ba51c7d

Browse files
committed
Fix null pointer in IsTrusted()
1 parent 334bd22 commit ba51c7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/wallet.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,8 +675,10 @@ class CWalletTx : public CMerkleTx
675675
{
676676
// Transactions not sent by us: not trusted
677677
const CWalletTx* parent = pwallet->GetWalletTx(txin.prevout.hash);
678+
if (parent == NULL)
679+
return false;
678680
const CTxOut& parentOut = parent->vout[txin.prevout.n];
679-
if (parent == NULL || !pwallet->IsMine(parentOut))
681+
if (!pwallet->IsMine(parentOut))
680682
return false;
681683
}
682684
return true;

0 commit comments

Comments
 (0)