Note that this function doesn't distinguish between a 0-valued input, and a not-"is mine" (according to the filter) input.
| 1370 | // Note that this function doesn't distinguish between a 0-valued input, |
| 1371 | // and a not-"is mine" (according to the filter) input. |
| 1372 | CAmountMap CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const |
| 1373 | { |
| 1374 | { |
| 1375 | LOCK(cs_wallet); |
| 1376 | std::map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash); |
| 1377 | if (mi != mapWallet.end()) |
| 1378 | { |
| 1379 | const CWalletTx& prev = (*mi).second; |
| 1380 | if (txin.prevout.n < prev.tx->vout.size()) |
| 1381 | if (IsMine(prev.tx->vout[txin.prevout.n]) & filter) { |
| 1382 | CAmountMap amounts; |
| 1383 | amounts[prev.GetOutputAsset(*this, txin.prevout.n)] = std::max<CAmount>(0, prev.GetOutputValueOut(*this, txin.prevout.n)); |
| 1384 | return amounts; |
| 1385 | } |
| 1386 | } |
| 1387 | } |
| 1388 | return CAmountMap(); |
| 1389 | } |
| 1390 | |
| 1391 | isminetype CWallet::IsMine(const CTxOut& txout) const |
| 1392 | { |
no test coverage detected