MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / GetDebit

Method GetDebit

src/wallet/wallet.cpp:1323–1337  ·  view source on GitHub ↗

Note that this function doesn't distinguish between a 0-valued input, and a not-"is mine" (according to the filter) input.

Source from the content-addressed store, hash-verified

1321// Note that this function doesn't distinguish between a 0-valued input,
1322// and a not-"is mine" (according to the filter) input.
1323CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const
1324{
1325 {
1326 LOCK(cs_wallet);
1327 std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
1328 if (mi != mapWallet.end())
1329 {
1330 const CWalletTx& prev = (*mi).second;
1331 if (txin.prevout.n < prev.tx->vout.size())
1332 if (IsMine(prev.tx->vout[txin.prevout.n]) & filter)
1333 return prev.tx->vout[txin.prevout.n].nValue;
1334 }
1335 }
1336 return 0;
1337}
1338
1339isminetype CWallet::IsMine(const CTxOut& txout) const
1340{

Callers 5

gettransactionFunction · 0.80
CreateTransactionFunction · 0.80
GetLegacyBalanceMethod · 0.80
MakeWalletTxFunction · 0.80
getDebitMethod · 0.80

Calls 6

IsMineFunction · 0.85
MoneyRangeFunction · 0.85
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected