aboutsummaryrefslogtreecommitdiffhomepage
path: root/tde2e
diff options
context:
space:
mode:
Diffstat (limited to 'tde2e')
-rw-r--r--tde2e/td/e2e/Blockchain.cpp1
-rw-r--r--tde2e/td/e2e/Call.cpp6
2 files changed, 4 insertions, 3 deletions
diff --git a/tde2e/td/e2e/Blockchain.cpp b/tde2e/td/e2e/Blockchain.cpp
index 139e4a3e0..a477beade 100644
--- a/tde2e/td/e2e/Blockchain.cpp
+++ b/tde2e/td/e2e/Blockchain.cpp
@@ -409,6 +409,7 @@ td::Status State::clear_shared_key(const Permissions &permissions) {
}
td::Status State::validate_shared_key(const GroupSharedKeyRef &shared_key, const GroupStateRef &group_state) {
+ CHECK(shared_key != nullptr);
if (shared_key->empty()) {
return td::Status::OK();
}
diff --git a/tde2e/td/e2e/Call.cpp b/tde2e/td/e2e/Call.cpp
index 806a01891..f249c1f29 100644
--- a/tde2e/td/e2e/Call.cpp
+++ b/tde2e/td/e2e/Call.cpp
@@ -313,8 +313,8 @@ td::Result<std::string> CallEncryption::decrypt(td::int64 user_id, td::int32 cha
TRY_STATUS(parser.get_status());
for (td::int32 i = 0; i < epochs_n; i++) {
- auto epoch_hash = epoch_hashes[i];
- auto encrypted_header = encrypted_headers[i];
+ const auto &epoch_hash = epoch_hashes[i];
+ const auto &encrypted_header = encrypted_headers[i];
if (auto it = epoch_by_hash_.find(epoch_hash); it != epoch_by_hash_.end()) {
auto it2 = epochs_.find(it->second);
if (it2 != epochs_.end()) {
@@ -567,7 +567,7 @@ td::Result<std::string> Call::create_self_add_block(const PrivateKey &private_ke
td::remove_if(old_state.participants,
[&self](const GroupParticipant &participant) { return participant.user_id == self.user_id; });
old_state.participants.push_back(self);
- auto new_group_state = std::make_shared<GroupState>(std::move(old_state));
+ auto new_group_state = std::make_shared<GroupState>(old_state);
TRY_RESULT(changes, make_changes_for_new_state(std::move(new_group_state)));
return blockchain.build_block(changes, private_key);
}