Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/walletdb.cpp
Show First 20 Lines • Show All 530 Lines • ▼ Show 20 Lines | DBErrors WalletBatch::LoadWallet(CWallet *pwallet) { | ||||
CWalletScanState wss; | CWalletScanState wss; | ||||
bool fNoncriticalErrors = false; | bool fNoncriticalErrors = false; | ||||
DBErrors result = DBErrors::LOAD_OK; | DBErrors result = DBErrors::LOAD_OK; | ||||
LOCK(pwallet->cs_wallet); | LOCK(pwallet->cs_wallet); | ||||
try { | try { | ||||
int nMinVersion = 0; | int nMinVersion = 0; | ||||
if (m_batch.Read((std::string) "minversion", nMinVersion)) { | if (m_batch.Read((std::string) "minversion", nMinVersion)) { | ||||
if (nMinVersion > CLIENT_VERSION) { | if (nMinVersion > FEATURE_LATEST) { | ||||
return DBErrors::TOO_NEW; | return DBErrors::TOO_NEW; | ||||
} | } | ||||
pwallet->LoadMinVersion(nMinVersion); | pwallet->LoadMinVersion(nMinVersion); | ||||
} | } | ||||
// Get cursor | // Get cursor | ||||
Dbc *pcursor = m_batch.GetCursor(); | Dbc *pcursor = m_batch.GetCursor(); | ||||
if (!pcursor) { | if (!pcursor) { | ||||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
DBErrors WalletBatch::FindWalletTx(std::vector<TxId> &txIds, | DBErrors WalletBatch::FindWalletTx(std::vector<TxId> &txIds, | ||||
std::vector<CWalletTx> &vWtx) { | std::vector<CWalletTx> &vWtx) { | ||||
DBErrors result = DBErrors::LOAD_OK; | DBErrors result = DBErrors::LOAD_OK; | ||||
try { | try { | ||||
int nMinVersion = 0; | int nMinVersion = 0; | ||||
if (m_batch.Read((std::string) "minversion", nMinVersion)) { | if (m_batch.Read((std::string) "minversion", nMinVersion)) { | ||||
if (nMinVersion > CLIENT_VERSION) { | if (nMinVersion > FEATURE_LATEST) { | ||||
return DBErrors::TOO_NEW; | return DBErrors::TOO_NEW; | ||||
} | } | ||||
} | } | ||||
// Get cursor | // Get cursor | ||||
Dbc *pcursor = m_batch.GetCursor(); | Dbc *pcursor = m_batch.GetCursor(); | ||||
if (!pcursor) { | if (!pcursor) { | ||||
LogPrintf("Error getting wallet database cursor\n"); | LogPrintf("Error getting wallet database cursor\n"); | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |