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

Method Close

src/wallet/db.cpp:86–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84//
85
86void BerkeleyEnvironment::Close()
87{
88 if (!fDbEnvInit)
89 return;
90
91 fDbEnvInit = false;
92
93 for (auto& db : mapDb) {
94 auto count = mapFileUseCount.find(db.first);
95 assert(count == mapFileUseCount.end() || count->second == 0);
96 if (db.second) {
97 db.second->close(0);
98 delete db.second;
99 db.second = nullptr;
100 }
101 }
102
103 int ret = dbenv->close(0);
104 if (ret != 0)
105 LogPrintf("BerkeleyEnvironment::Close: Error %d closing database environment: %s\n", ret, DbEnv::strerror(ret));
106 if (!fMockDb)
107 DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);
108}
109
110void BerkeleyEnvironment::Reset()
111{

Callers 2

RewriteMethod · 0.45
BerkeleyDatabaseMethod · 0.45

Calls 3

findMethod · 0.45
endMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected