| 31 | } |
| 32 | |
| 33 | bool AllInputsMine(const CWallet& wallet, const CTransaction& tx, const isminefilter& filter) |
| 34 | { |
| 35 | LOCK(wallet.cs_wallet); |
| 36 | |
| 37 | for (const CTxIn& txin : tx.vin) |
| 38 | { |
| 39 | auto mi = wallet.mapWallet.find(txin.prevout.hash); |
| 40 | if (mi == wallet.mapWallet.end()) |
| 41 | return false; // any unknown inputs can't be from us |
| 42 | |
| 43 | const CWalletTx& prev = (*mi).second; |
| 44 | |
| 45 | if (txin.prevout.n >= prev.tx->vout.size()) |
| 46 | return false; // invalid input! |
| 47 | |
| 48 | if (!(wallet.IsMine(prev.tx->vout[txin.prevout.n]) & filter)) |
| 49 | return false; |
| 50 | } |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | CAmountMap OutputGetCredit(const CWallet& wallet, const CTransaction& tx, const size_t out_index, const isminefilter& filter) { |
| 55 | std::map<uint256, CWalletTx>::const_iterator mi = wallet.mapWallet.find(tx.GetHash()); |
no test coverage detected