Remove unused is_database_encrypted.

This commit is contained in:
levlam 2022-09-07 21:32:40 +03:00
parent 287cceb162
commit c47da24430
4 changed files with 0 additions and 12 deletions

View File

@ -3550,7 +3550,6 @@ void Td::on_parameters_checked(Result<TdDb::CheckedParameters> r_checked_paramet
parameters_.database_directory = std::move(checked_parameters.database_directory);
parameters_.files_directory = std::move(checked_parameters.files_directory);
is_database_encrypted_ = checked_parameters.is_database_encrypted;
VLOG(td_init) << "Begin to init database";
auto promise = PromiseCreator::lambda([actor_id = actor_id(this)](Result<TdDb::OpenedDatabase> r_opened_database) {

View File

@ -294,7 +294,6 @@ class Td final : public Actor {
enum class State : int32 { WaitParameters, Run, Close } state_ = State::WaitParameters;
uint64 set_parameters_request_id_ = 0;
string database_encryption_key_;
bool is_database_encrypted_ = false;
FlatHashMap<uint64, std::shared_ptr<ResultHandler>> result_handlers_;
enum : int8 { RequestActorIdType = 1, ActorIdType = 2 };

View File

@ -519,15 +519,6 @@ void TdDb::check_parameters_impl(TdParameters parameters, Promise<CheckedParamet
}
result.files_directory = r_files_directory.move_as_ok();
Binlog binlog;
auto status = binlog.init(get_binlog_path(parameters), Binlog::Callback());
if (status.is_error() && status.code() != Binlog::Error::WrongPassword) {
LOG(WARNING) << "Failed to check binlog: " << status;
return promise.set_error(std::move(status));
}
result.is_database_encrypted = binlog.get_info().wrong_password;
binlog.close(false /*need_sync*/).ensure();
promise.set_value(std::move(result));
}

View File

@ -50,7 +50,6 @@ class TdDb {
struct CheckedParameters {
string database_directory;
string files_directory;
bool is_database_encrypted{false};
};
static void check_parameters(int32 scheduler_id, TdParameters parameters, Promise<CheckedParameters> promise);