Skip to content

Commit

Permalink
Changed TransparentTxout::IsFromMe() implementation to fix bugs in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
psolstice committed Aug 18, 2024
1 parent f603de6 commit 3423301
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,7 @@ bool CTransparentTxout::IsFromMe() const {
assert(wallet);
AssertLockHeld(wallet->cs_wallet);

for (const CTxIn& txin: wallet->mapWallet.at(GetHash()).tx->vin) {
std::map<uint256, CWalletTx>::const_iterator mi = wallet->mapWallet.find(txin.prevout.hash);
if (mi == wallet->mapWallet.end())
return false;

if (!(::IsMine(*wallet, mi->second.tx->vout.at(txin.prevout.n).scriptPubKey, SIGVERSION_BASE) & ISMINE_ALL))
return false;
}

return true;
return wallet->GetDebit(*wallet->mapWallet.at(GetHash()).tx, ISMINE_ALL) > 0;
}

unsigned int CTransparentTxout::GetDepthInMainChain() const {
Expand Down

0 comments on commit 3423301

Please sign in to comment.