| 1013 | } |
| 1014 | |
| 1015 | void CWallet::LoadToWallet(const CWalletTx& wtxIn) |
| 1016 | { |
| 1017 | uint256 hash = wtxIn.GetHash(); |
| 1018 | const auto& ins = mapWallet.emplace(hash, wtxIn); |
| 1019 | CWalletTx& wtx = ins.first->second; |
| 1020 | wtx.BindWallet(this); |
| 1021 | if (/* insertion took place */ ins.second) { |
| 1022 | wtx.m_it_wtxOrdered = wtxOrdered.insert(std::make_pair(wtx.nOrderPos, TxPair(&wtx, nullptr))); |
| 1023 | } |
| 1024 | AddToSpends(hash); |
| 1025 | for (const CTxIn& txin : wtx.tx->vin) { |
| 1026 | auto it = mapWallet.find(txin.prevout.hash); |
| 1027 | if (it != mapWallet.end()) { |
| 1028 | CWalletTx& prevtx = it->second; |
| 1029 | if (prevtx.nIndex == -1 && !prevtx.hashUnset()) { |
| 1030 | MarkConflicted(prevtx.hashBlock, wtx.GetHash()); |
| 1031 | } |
| 1032 | } |
| 1033 | } |
| 1034 | } |
| 1035 | |
| 1036 | bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef& ptx, const CBlockIndex* pIndex, int posInBlock, bool fUpdate) |
| 1037 | { |
no test coverage detected