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

Method LoadWallet

src/wallet/wallet.cpp:3142–3171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3140}
3141
3142DBErrors CWallet::LoadWallet(bool& fFirstRunRet)
3143{
3144 LOCK2(cs_main, cs_wallet);
3145
3146 fFirstRunRet = false;
3147 DBErrors nLoadWalletRet = WalletBatch(*database,"cr+").LoadWallet(this);
3148 if (nLoadWalletRet == DBErrors::NEED_REWRITE)
3149 {
3150 if (database->Rewrite("\x04pool"))
3151 {
3152 setInternalKeyPool.clear();
3153 setExternalKeyPool.clear();
3154 m_pool_key_to_index.clear();
3155 // Note: can't top-up keypool here, because wallet is locked.
3156 // User will be prompted to unlock wallet the next operation
3157 // that requires a new key.
3158 }
3159 }
3160
3161 {
3162 LOCK(cs_KeyStore);
3163 // This wallet is in its first run if all of these are empty
3164 fFirstRunRet = mapKeys.empty() && mapCryptedKeys.empty() && mapWatchKeys.empty() && setWatchOnly.empty() && mapScripts.empty() && !IsWalletFlagSet(WALLET_FLAG_DISABLE_PRIVATE_KEYS);
3165 }
3166
3167 if (nLoadWalletRet != DBErrors::LOAD_OK)
3168 return nLoadWalletRet;
3169
3170 return DBErrors::LOAD_OK;
3171}
3172
3173DBErrors CWallet::ZapSelectTx(std::vector<uint256>& vHashIn, std::vector<uint256>& vHashOut)
3174{

Callers 5

CreateWalletFromFileMethod · 0.45
ListCoinsTestingSetupMethod · 0.45
WalletTestingSetupMethod · 0.45
TestGUIFunction · 0.45

Calls 4

WalletBatchClass · 0.85
RewriteMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45

Tested by 4

ListCoinsTestingSetupMethod · 0.36
WalletTestingSetupMethod · 0.36
TestGUIFunction · 0.36