Skip to content

Commit

Permalink
Wallet::CreateWalletFromFile guard direct chainActive access
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Mar 10, 2021
1 parent f889dcb commit c4952a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4222,11 +4222,12 @@ CWallet* CWallet::CreateWalletFromFile(const std::string walletFile)
return nullptr;
}

walletInstance->SetBestChain(chainActive.GetLocator());
walletInstance->SetBestChain(WITH_LOCK(cs_main, return chainActive.GetLocator()));
}

LogPrintf("Wallet completed loading in %15dms\n", GetTimeMillis() - nStart);

LOCK(cs_main);
CBlockIndex* pindexRescan = chainActive.Genesis();
if (!gArgs.GetBoolArg("-rescan", false)) {
CWalletDB walletdb(*walletInstance->dbw);
Expand Down

0 comments on commit c4952a2

Please sign in to comment.