From 129e673769cc376c67f27aa34ba9f4a85dd2dd59 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 14 Aug 2020 19:53:26 +0300 Subject: [PATCH] Minor. GitOrigin-RevId: 17528428dd1741527565d1b2bc012928d3f24c80 --- tddb/td/db/SqliteDb.cpp | 4 ++-- tddb/td/db/SqliteDb.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tddb/td/db/SqliteDb.cpp b/tddb/td/db/SqliteDb.cpp index e8ba99562..ec23a50c5 100644 --- a/tddb/td/db/SqliteDb.cpp +++ b/tddb/td/db/SqliteDb.cpp @@ -192,9 +192,9 @@ Result SqliteDb::do_open_with_key(CSlice path, const DbKey &db_key, in LOG(INFO) << "Try Sqlcipher compatibility mode with version=" << cipher_version; TRY_STATUS(db.exec(PSLICE() << "PRAGMA cipher_compatibility = " << cipher_version)); } - db.set_cipher_version(cipher_version); } TRY_STATUS_PREFIX(db.check_encryption(), "Can't open database: "); + db.set_cipher_version(cipher_version); return std::move(db); } @@ -202,7 +202,7 @@ void SqliteDb::set_cipher_version(int32 cipher_version) { raw_->set_cipher_version(cipher_version); } -optional SqliteDb::get_cipher_version() { +optional SqliteDb::get_cipher_version() const { return raw_->get_cipher_version(); } diff --git a/tddb/td/db/SqliteDb.h b/tddb/td/db/SqliteDb.h index c65792547..49974d465 100644 --- a/tddb/td/db/SqliteDb.h +++ b/tddb/td/db/SqliteDb.h @@ -78,7 +78,7 @@ class SqliteDb { detail::RawSqliteDb::with_db_path(main_path, f); } - optional get_cipher_version(); + optional get_cipher_version() const; private: explicit SqliteDb(std::shared_ptr raw) : raw_(std::move(raw)) {