MCPcopy Create free account
hub / github.com/LUX-Core/lux / LoadWallet

Method LoadWallet

src/wallet.cpp:3422–3449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3420}
3421
3422DBErrors 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
3451DBErrors CWallet::ZapSelectTx(vector<uint256>& vHashIn, vector<uint256>& vHashOut)
3452{

Callers 2

AppInit2Function · 0.45
TestingSetupMethod · 0.45

Calls 3

CWalletDBClass · 0.85
clearMethod · 0.45
IsValidMethod · 0.45

Tested by 1

TestingSetupMethod · 0.36