|
|
@ -670,7 +670,7 @@ void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountin |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool CWalletDB::LoadWallet(CWallet* pwallet) |
|
|
|
int CWalletDB::LoadWallet(CWallet* pwallet) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pwallet->vchDefaultKey.clear(); |
|
|
|
pwallet->vchDefaultKey.clear(); |
|
|
|
int nFileVersion = 0; |
|
|
|
int nFileVersion = 0; |
|
|
@ -690,7 +690,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet) |
|
|
|
// Get cursor
|
|
|
|
// Get cursor
|
|
|
|
Dbc* pcursor = GetCursor(); |
|
|
|
Dbc* pcursor = GetCursor(); |
|
|
|
if (!pcursor) |
|
|
|
if (!pcursor) |
|
|
|
return false; |
|
|
|
return DB_CORRUPT; |
|
|
|
|
|
|
|
|
|
|
|
loop |
|
|
|
loop |
|
|
|
{ |
|
|
|
{ |
|
|
@ -701,7 +701,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet) |
|
|
|
if (ret == DB_NOTFOUND) |
|
|
|
if (ret == DB_NOTFOUND) |
|
|
|
break; |
|
|
|
break; |
|
|
|
else if (ret != 0) |
|
|
|
else if (ret != 0) |
|
|
|
return false; |
|
|
|
return DB_CORRUPT; |
|
|
|
|
|
|
|
|
|
|
|
// Unserialize
|
|
|
|
// Unserialize
|
|
|
|
// Taking advantage of the fact that pair serialization
|
|
|
|
// Taking advantage of the fact that pair serialization
|
|
|
@ -809,6 +809,13 @@ bool CWalletDB::LoadWallet(CWallet* pwallet) |
|
|
|
if (strKey == "addrProxy") ssValue >> addrProxy; |
|
|
|
if (strKey == "addrProxy") ssValue >> addrProxy; |
|
|
|
if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP; |
|
|
|
if (fHaveUPnP && strKey == "fUseUPnP") ssValue >> fUseUPnP; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else if (strType == "minversion") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int nMinVersion = 0; |
|
|
|
|
|
|
|
ssValue >> nMinVersion; |
|
|
|
|
|
|
|
if (nMinVersion > VERSION) |
|
|
|
|
|
|
|
return DB_TOO_NEW; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
pcursor->close(); |
|
|
|
pcursor->close(); |
|
|
|
} |
|
|
|
} |
|
|
@ -839,7 +846,7 @@ bool CWalletDB::LoadWallet(CWallet* pwallet) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return DB_LOAD_OK; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void ThreadFlushWalletDB(void* parg) |
|
|
|
void ThreadFlushWalletDB(void* parg) |
|
|
|