MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / LoadWallet

Method LoadWallet

src/wallet/wallet.cpp:2088–2113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2086
2087
2088DBErrors CWallet::LoadWallet(bool& fFirstRunRet)
2089{
2090 if (!fFileBacked)
2091 return DB_LOAD_OK;
2092 fFirstRunRet = false;
2093 DBErrors nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this);
2094 if (nLoadWalletRet == DB_NEED_REWRITE)
2095 {
2096 if (CDB::Rewrite(strWalletFile, "\x04pool"))
2097 {
2098 LOCK(cs_wallet);
2099 setKeyPool.clear();
2100 // Note: can't top-up keypool here, because wallet is locked.
2101 // User will be prompted to unlock wallet the next operation
2102 // that requires a new key.
2103 }
2104 }
2105
2106 if (nLoadWalletRet != DB_LOAD_OK)
2107 return nLoadWalletRet;
2108 fFirstRunRet = !vchDefaultKey.IsValid();
2109
2110 uiInterface.LoadWallet(this);
2111
2112 return DB_LOAD_OK;
2113}
2114
2115
2116DBErrors CWallet::ZapWalletTx(std::vector<CWalletTx>& vWtx)

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