wallet: don't read db every time that a new WalletBatch is created

Better to perform the action only one time (during 'LoadWallet').
Where the value is being used.
This commit is contained in:
furszy
2022-06-16 10:30:04 -03:00
parent 26ec2f2d6b
commit bda8ebe608
2 changed files with 3 additions and 11 deletions

View File

@@ -315,12 +315,6 @@ BerkeleyBatch::BerkeleyBatch(BerkeleyDatabase& database, const bool read_only, b
env = database.env.get();
pdb = database.m_db.get();
strFile = fs::PathToString(database.m_filename);
if (!Exists(std::string("version"))) {
bool fTmp = fReadOnly;
fReadOnly = false;
Write(std::string("version"), CLIENT_VERSION);
fReadOnly = fTmp;
}
}
void BerkeleyDatabase::Open()