Bitcoin
|
Functions | |
void | CheckUniqueFileid (const BerkeleyEnvironment &env, const std::string &filename, Db &db, WalletDatabaseFileId &fileid) |
std::map< std::string, std::weak_ptr< BerkeleyEnvironment > > g_dbenvs | GUARDED_BY (cs_db) |
Map from directory name to db environment. More... | |
Variables | |
CCriticalSection | cs_db |
void anonymous_namespace{db.cpp}::CheckUniqueFileid | ( | const BerkeleyEnvironment & | env, |
const std::string & | filename, | ||
Db & | db, | ||
WalletDatabaseFileId & | fileid | ||
) |
Make sure database has a unique fileid within the environment. If it doesn't, throw an error. BDB caches do not work properly when more than one open database has the same fileid (values written to one database may show up in reads to other databases).
BerkeleyDB generates unique fileids by default (https://docs.oracle.com/cd/E17275_01/html/programmer_reference/program_copy.html), so bitcoin should never create different databases with the same fileid, but this error can be triggered if users manually copy database files.
std::map<std::string, std::weak_ptr<BerkeleyEnvironment> > g_dbenvs anonymous_namespace{db.cpp}::GUARDED_BY | ( | cs_db | ) |
Map from directory name to db environment.
CCriticalSection anonymous_namespace{db.cpp}::cs_db |