Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/db.cpp
Show First 20 Lines • Show All 542 Lines • ▼ Show 20 Lines | if (fCreate) { | ||||
// not obviously identical symlinked or hard linked or bind mounted | // not obviously identical symlinked or hard linked or bind mounted | ||||
// paths. In the future a more relaxed check for equal inode and | // paths. In the future a more relaxed check for equal inode and | ||||
// device ids could be done instead, which would allow opening | // device ids could be done instead, which would allow opening | ||||
// different backup copies of a wallet at the same time. Maybe even | // different backup copies of a wallet at the same time. Maybe even | ||||
// more ideally, an exclusive lock for accessing the database could | // more ideally, an exclusive lock for accessing the database could | ||||
// be implemented, so no equality checks are needed at all. (Newer | // be implemented, so no equality checks are needed at all. (Newer | ||||
// versions of BDB have an set_lk_exclusive method for this | // versions of BDB have an set_lk_exclusive method for this | ||||
// purpose, but the older version we use does not.) | // purpose, but the older version we use does not.) | ||||
for (auto &dbenv : g_dbenvs) { | for (const auto &dbenv : g_dbenvs) { | ||||
CheckUniqueFileid(dbenv.second, strFilename, *pdb_temp); | CheckUniqueFileid(dbenv.second, strFilename, *pdb_temp); | ||||
} | } | ||||
pdb = pdb_temp.release(); | pdb = pdb_temp.release(); | ||||
env->mapDb[strFilename] = pdb; | env->mapDb[strFilename] = pdb; | ||||
if (fCreate && !Exists(std::string("version"))) { | if (fCreate && !Exists(std::string("version"))) { | ||||
bool fTmp = fReadOnly; | bool fTmp = fReadOnly; | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |