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

small db changes

This commit is contained in:
ton 2020-04-07 19:35:04 +04:00
parent cea5281ad3
commit 148a5e0179
4 changed files with 49 additions and 17 deletions

View file

@ -216,7 +216,7 @@ void ArchiveManager::get_file_short(FileReference ref_id, td::Promise<td::Buffer
td::actor::send_closure(SelfId, &ArchiveManager::get_temp_file_short, std::move(ref_id), std::move(promise));
}
});
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, ref_id, std::move(P));
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, nullptr, ref_id, std::move(P));
return;
}
}
@ -239,7 +239,7 @@ void ArchiveManager::get_key_block_proof(FileReference ref_id, td::Promise<td::B
if (search_in_key) {
auto f = get_file_desc_by_seqno(block_id.shard_full(), block_id.seqno(), true);
if (f) {
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, ref_id, std::move(promise));
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, nullptr, ref_id, std::move(promise));
} else {
promise.set_error(td::Status::Error(ErrorCode::notready, "key proof not in db"));
}
@ -267,14 +267,15 @@ void ArchiveManager::get_file_short_cont(FileReference ref_id, PackageId idx, td
td::actor::send_closure(SelfId, &ArchiveManager::get_file_short_cont, std::move(ref_id), idx, std::move(promise));
}
});
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, std::move(ref_id), std::move(P));
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, nullptr, std::move(ref_id), std::move(P));
}
void ArchiveManager::get_file(ConstBlockHandle handle, FileReference ref_id, td::Promise<td::BufferSlice> promise) {
if (handle->moved_to_archive()) {
auto f = get_file_desc(handle->id().shard_full(), get_package_id(handle->masterchain_ref_block()), 0, 0, 0, false);
if (f) {
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, std::move(ref_id), std::move(promise));
td::actor::send_closure(f->file_actor_id(), &ArchiveSlice::get_file, std::move(handle), std::move(ref_id),
std::move(promise));
return;
}
}