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

Function OutputGetCredit

src/wallet/receive.cpp:54–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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());
56 if (mi != wallet.mapWallet.end())
57 {
58 const CWalletTx& wtx = (*mi).second;
59 if (out_index < wtx.tx->vout.size() && wallet.IsMine(wtx.tx->vout[out_index]) & filter) {
60 CAmountMap amounts;
61 amounts[wtx.GetOutputAsset(wallet, out_index)] = std::max<CAmount>(0, wtx.GetOutputValueOut(wallet, out_index));
62 return amounts;
63 }
64 }
65 return CAmountMap();
66}
67
68CAmountMap TxGetCredit(const CWallet& wallet, const CWalletTx& wtx, const isminefilter& filter) {
69 CAmountMap nCredit;

Callers 1

getCreditMethod · 0.85

Calls 7

findMethod · 0.80
GetOutputAssetMethod · 0.80
GetOutputValueOutMethod · 0.80
GetHashMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
IsMineMethod · 0.45

Tested by

no test coverage detected