diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index bb7be2df3..78abd7700 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -4017,6 +4017,8 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile) // Try to top up keypool. No-op if the wallet is locked. walletInstance->TopUpKeyPool(); + LOCK(cs_main); + CBlockIndex *pindexRescan = chainActive.Genesis(); if (!gArgs.GetBoolArg("-rescan", false)) {