Note that this function doesn't distinguish between a 0-valued input, and a not-"is mine" (according to the filter) input.
| 1321 | // Note that this function doesn't distinguish between a 0-valued input, |
| 1322 | // and a not-"is mine" (according to the filter) input. |
| 1323 | CAmount 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 | |
| 1339 | isminetype CWallet::IsMine(const CTxOut& txout) const |
| 1340 | { |
no test coverage detected