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

Method LoadToWallet

src/wallet/wallet.cpp:1015–1034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1013}
1014
1015void 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
1036bool CWallet::AddToWalletIfInvolvingMe(const CTransactionRef& ptx, const CBlockIndex* pIndex, int posInBlock, bool fUpdate)
1037{

Callers 1

walletdb.cppFile · 0.80

Calls 6

BindWalletMethod · 0.80
hashUnsetMethod · 0.80
GetHashMethod · 0.45
insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected