[bitcoin/bitcoin] [wallet] Reopen CDBEnv after encryption instead of shutting down (#12493)

promag commented on this pull request.

utACK c1dde3a.

> @@ -572,6 +573,32 @@ void BerkeleyEnvironment::CloseDb(const std::string& strFile)
}
}

+void BerkeleyEnvironment::ReloadDbEnv()
+{
+ // Make sure that no Db’s are in use
+ AssertLockNotHeld(cs_db);
+ std::unique_lock lock(cs_db);
+ m_db_in_use.wait(lock, [this](){
+ for (auto& count : mapFileUseCount) {

Don’t use iterator references?