| 3420 | } |
| 3421 | |
| 3422 | DBErrors CWallet::LoadWallet(bool& fFirstRunRet) |
| 3423 | { |
| 3424 | if (!fFileBacked) |
| 3425 | return DB_LOAD_OK; |
| 3426 | fFirstRunRet = false; |
| 3427 | DBErrors nLoadWalletRet = CWalletDB(strWalletFile, "cr+").LoadWallet(this); |
| 3428 | if (nLoadWalletRet == DB_NEED_REWRITE) { |
| 3429 | if (CDB::Rewrite(strWalletFile, "\x04pool")) { |
| 3430 | LOCK(cs_wallet); |
| 3431 | //setKeyPool.clear(); |
| 3432 | setInternalKeyPool.clear(); |
| 3433 | setExternalKeyPool.clear(); |
| 3434 | nKeysLeftSinceAutoBackup = 0; |
| 3435 | // m_pool_key_to_index.clear(); |
| 3436 | // Note: can't top-up keypool here, because wallet is locked. |
| 3437 | // User will be prompted to unlock wallet the next operation |
| 3438 | // the requires a new key. |
| 3439 | } |
| 3440 | } |
| 3441 | |
| 3442 | if (nLoadWalletRet != DB_LOAD_OK) |
| 3443 | return nLoadWalletRet; |
| 3444 | fFirstRunRet = !vchDefaultKey.IsValid(); |
| 3445 | |
| 3446 | uiInterface.LoadWallet(this); |
| 3447 | |
| 3448 | return DB_LOAD_OK; |
| 3449 | } |
| 3450 | |
| 3451 | DBErrors CWallet::ZapSelectTx(vector<uint256>& vHashIn, vector<uint256>& vHashOut) |
| 3452 | { |