MCPcopy Create free account
hub / github.com/ElementsProject/elements / ReloadDbEnv

Method ReloadDbEnv

src/wallet/bdb.cpp:424–449  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

422}
423
424void BerkeleyEnvironment::ReloadDbEnv()
425{
426 // Make sure that no Db's are in use
427 AssertLockNotHeld(cs_db);
428 std::unique_lock<RecursiveMutex> lock(cs_db);
429 m_db_in_use.wait(lock, [this](){
430 for (auto& db : m_databases) {
431 if (db.second.get().m_refcount > 0) return false;
432 }
433 return true;
434 });
435
436 std::vector<std::string> filenames;
437 for (auto it : m_databases) {
438 filenames.push_back(it.first);
439 }
440 // Close the individual Db's
441 for (const std::string& filename : filenames) {
442 CloseDb(filename);
443 }
444 // Reset the environment
445 Flush(true); // This will flush and close the environment
446 Reset();
447 bilingual_str open_err;
448 Open(open_err);
449}
450
451bool BerkeleyDatabase::Rewrite(const char* pszSkip)
452{

Callers 1

EncryptWalletMethod · 0.45

Calls 3

waitMethod · 0.80
getMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected