mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-13 11:25:02 -05:00
wallet: clean InputIsMine code, use GetWalletTx
This commit is contained in:
parent
0cb177263c
commit
bf310b0e8c
1 changed files with 4 additions and 7 deletions
|
@ -9,15 +9,12 @@
|
||||||
#include <wallet/wallet.h>
|
#include <wallet/wallet.h>
|
||||||
|
|
||||||
namespace wallet {
|
namespace wallet {
|
||||||
isminetype InputIsMine(const CWallet& wallet, const CTxIn &txin)
|
isminetype InputIsMine(const CWallet& wallet, const CTxIn& txin)
|
||||||
{
|
{
|
||||||
AssertLockHeld(wallet.cs_wallet);
|
AssertLockHeld(wallet.cs_wallet);
|
||||||
std::map<uint256, CWalletTx>::const_iterator mi = wallet.mapWallet.find(txin.prevout.hash);
|
const CWalletTx* prev = wallet.GetWalletTx(txin.prevout.hash);
|
||||||
if (mi != wallet.mapWallet.end())
|
if (prev && txin.prevout.n < prev->tx->vout.size()) {
|
||||||
{
|
return wallet.IsMine(prev->tx->vout[txin.prevout.n]);
|
||||||
const CWalletTx& prev = (*mi).second;
|
|
||||||
if (txin.prevout.n < prev.tx->vout.size())
|
|
||||||
return wallet.IsMine(prev.tx->vout[txin.prevout.n]);
|
|
||||||
}
|
}
|
||||||
return ISMINE_NO;
|
return ISMINE_NO;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue