MCPcopy Create free account
hub / github.com/ElementsProject/elements / AllInputsMine

Function AllInputsMine

src/wallet/receive.cpp:33–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33bool 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
54CAmountMap 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());

Callers 1

feebumper.cppFile · 0.85

Calls 4

findMethod · 0.80
endMethod · 0.45
sizeMethod · 0.45
IsMineMethod · 0.45

Tested by

no test coverage detected