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

Merge branch 'testnet' into block-generation

This commit is contained in:
SpyCheese 2023-07-21 19:29:57 +03:00
commit 66b98b6d6a
2 changed files with 4 additions and 4 deletions

View file

@ -82,10 +82,9 @@ class WriteFile : public td::actor::Actor {
: tmp_dir_(tmp_dir), new_name_(new_name), promise_(std::move(promise)) {
write_data_ = [data_ptr = std::make_shared<td::BufferSlice>(std::move(data))] (td::FileFd& fd) {
auto data = std::move(*data_ptr);
td::uint64 offset = 0;
while (data.size() > 0) {
TRY_RESULT(s, fd.pwrite(data.as_slice(), offset));
offset += s;
auto piece_size = std::min<size_t>(data.size(), 1 << 30);
TRY_RESULT(s, fd.write(data.as_slice().substr(0, piece_size)));
data.confirm_read(s);
}
return td::Status::OK();