Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 952 Lines • ▼ Show 20 Lines | bool CWallet::AddToWallet(const CWalletTx &wtxIn, bool fFlushOnClose) { | ||||
// Inserts only if not already there, returns tx inserted or tx found. | // Inserts only if not already there, returns tx inserted or tx found. | ||||
std::pair<std::map<TxId, CWalletTx>::iterator, bool> ret = | std::pair<std::map<TxId, CWalletTx>::iterator, bool> ret = | ||||
mapWallet.insert(std::make_pair(txid, wtxIn)); | mapWallet.insert(std::make_pair(txid, wtxIn)); | ||||
CWalletTx &wtx = (*ret.first).second; | CWalletTx &wtx = (*ret.first).second; | ||||
wtx.BindWallet(this); | wtx.BindWallet(this); | ||||
bool fInsertedNew = ret.second; | bool fInsertedNew = ret.second; | ||||
if (fInsertedNew) { | if (fInsertedNew) { | ||||
wtx.nTimeReceived = GetAdjustedTime(); | wtx.nTimeReceived = chain().getAdjustedTime(); | ||||
wtx.nOrderPos = IncOrderPosNext(&batch); | wtx.nOrderPos = IncOrderPosNext(&batch); | ||||
wtx.m_it_wtxOrdered = | wtx.m_it_wtxOrdered = | ||||
wtxOrdered.insert(std::make_pair(wtx.nOrderPos, &wtx)); | wtxOrdered.insert(std::make_pair(wtx.nOrderPos, &wtx)); | ||||
wtx.nTimeSmart = ComputeTimeSmart(wtx); | wtx.nTimeSmart = ComputeTimeSmart(wtx); | ||||
AddToSpends(txid); | AddToSpends(txid); | ||||
} | } | ||||
bool fUpdated = false; | bool fUpdated = false; | ||||
▲ Show 20 Lines • Show All 3,982 Lines • Show Last 20 Lines |