diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2022-07-04 19:53:04 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2022-07-05 10:10:33 -0300 |
commit | bf310b0e8ce82d52bacceeb47c9f5dbb26885f7e (patch) | |
tree | e32f5551073dc2ca82ff91ea24c02f60485628b8 /src/wallet/receive.cpp | |
parent | 0cb177263c36118094b7cd3b8f94741c0471ff62 (diff) | |
download | bitcoin-bf310b0e8ce82d52bacceeb47c9f5dbb26885f7e.tar.xz |
wallet: clean InputIsMine code, use GetWalletTx
Diffstat (limited to 'src/wallet/receive.cpp')
-rw-r--r-- | src/wallet/receive.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/wallet/receive.cpp b/src/wallet/receive.cpp index ec990339a3..1f76704b93 100644 --- a/src/wallet/receive.cpp +++ b/src/wallet/receive.cpp @@ -9,15 +9,12 @@ #include <wallet/wallet.h> namespace wallet { -isminetype InputIsMine(const CWallet& wallet, const CTxIn &txin) +isminetype InputIsMine(const CWallet& wallet, const CTxIn& txin) { AssertLockHeld(wallet.cs_wallet); - std::map<uint256, CWalletTx>::const_iterator mi = wallet.mapWallet.find(txin.prevout.hash); - if (mi != wallet.mapWallet.end()) - { - const CWalletTx& prev = (*mi).second; - if (txin.prevout.n < prev.tx->vout.size()) - return wallet.IsMine(prev.tx->vout[txin.prevout.n]); + const CWalletTx* prev = wallet.GetWalletTx(txin.prevout.hash); + if (prev && txin.prevout.n < prev->tx->vout.size()) { + return wallet.IsMine(prev->tx->vout[txin.prevout.n]); } return ISMINE_NO; } |