Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 3,476 Lines • ▼ Show 20 Lines | if (fBroadcastTransactions) { | ||||
} else { | } else { | ||||
wtx.RelayWalletTransaction(*locked_chain, connman); | wtx.RelayWalletTransaction(*locked_chain, connman); | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool CWallet::AddAccountingEntry(const CAccountingEntry &acentry) { | |||||
WalletBatch batch(*database); | |||||
return AddAccountingEntry(acentry, &batch); | |||||
} | |||||
bool CWallet::AddAccountingEntry(const CAccountingEntry &acentry, | |||||
WalletBatch *batch) { | |||||
if (!batch->WriteAccountingEntry(++nAccountingEntryNumber, acentry)) { | |||||
return false; | |||||
} | |||||
laccentries.push_back(acentry); | |||||
CAccountingEntry &entry = laccentries.back(); | |||||
wtxOrdered.insert(std::make_pair(entry.nOrderPos, TxPair(nullptr, &entry))); | |||||
return true; | |||||
} | |||||
DBErrors CWallet::LoadWallet(bool &fFirstRunRet) { | DBErrors CWallet::LoadWallet(bool &fFirstRunRet) { | ||||
auto locked_chain = chain().lock(); | auto locked_chain = chain().lock(); | ||||
LOCK(cs_wallet); | LOCK(cs_wallet); | ||||
fFirstRunRet = false; | fFirstRunRet = false; | ||||
DBErrors nLoadWalletRet = WalletBatch(*database, "cr+").LoadWallet(this); | DBErrors nLoadWalletRet = WalletBatch(*database, "cr+").LoadWallet(this); | ||||
if (nLoadWalletRet == DBErrors::NEED_REWRITE) { | if (nLoadWalletRet == DBErrors::NEED_REWRITE) { | ||||
if (database->Rewrite("\x04pool")) { | if (database->Rewrite("\x04pool")) { | ||||
▲ Show 20 Lines • Show All 1,512 Lines • Show Last 20 Lines |