1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Fix typos, UBs and warnings (#625)

This commit is contained in:
SpyCheese 2023-02-28 09:06:09 +00:00 committed by GitHub
parent 5a47495d87
commit 0578cb4a42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 193 additions and 139 deletions

View file

@ -91,7 +91,7 @@ void CellDbIn::load_cell(RootHash hash, td::Promise<td::Ref<vm::DataCell>> promi
}
void CellDbIn::store_cell(BlockIdExt block_id, td::Ref<vm::Cell> cell, td::Promise<td::Ref<vm::DataCell>> promise) {
td::PerfWarningTimer{"storecell", 0.1};
td::PerfWarningTimer timer{"storecell", 0.1};
auto key_hash = get_key_hash(block_id);
auto R = get_block(key_hash);
// duplicate
@ -194,7 +194,7 @@ void CellDbIn::gc_cont(BlockHandle handle) {
}
void CellDbIn::gc_cont2(BlockHandle handle) {
td::PerfWarningTimer{"gccell", 0.1};
td::PerfWarningTimer timer{"gccell", 0.1};
auto FR = get_block(last_gc_);
FR.ensure();

View file

@ -1050,9 +1050,9 @@ bool LiteQuery::make_state_root_proof(Ref<vm::Cell>& proof, Ref<vm::Cell> state_
&& upd_cs.size_ext() == 0x20228)) {
return fatal_error("invalid Merkle update in block");
}
auto upd_hash = upd_cs.prefetch_ref(1)->get_hash(0).bits();
auto state_hash = state_root->get_hash().bits();
if (upd_hash.compare(state_hash, 256)) {
auto upd_hash = upd_cs.prefetch_ref(1)->get_hash(0);
auto state_hash = state_root->get_hash();
if (upd_hash != state_hash) {
return fatal_error("cannot construct Merkle proof for given masterchain state because of hash mismatch");
}
if (!pb.extract_proof_to(proof)) {

View file

@ -67,11 +67,10 @@ void TokenManager::download_token_cleared(size_t download_size, td::uint32 prior
}
void TokenManager::alarm() {
for (auto it = pending_.begin(); it != pending_.end(); it++) {
for (auto it = pending_.begin(); it != pending_.end();) {
if (it->second.timeout.is_in_past()) {
it->second.promise.set_error(td::Status::Error(ErrorCode::timeout, "timeout in wait download token"));
auto it2 = it++;
pending_.erase(it2);
it = pending_.erase(it);
} else {
it++;
}