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

A few improvements in storage-daemon-cli interface (#570)

* Pause and resume upload in storage-daemon

* Update help

* Update LoadSpeed.cpp

* Fix json output, prohibit torrents without files

Co-authored-by: SpyCheese <mikle98@yandex.ru>
Co-authored-by: Andrey Pfau <andreypfau@ton.org>
This commit is contained in:
EmelyanenkoK 2022-12-24 13:10:09 +03:00 committed by GitHub
parent 1a07edfed4
commit b88eda83fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View file

@ -98,6 +98,9 @@ TD_WARN_UNUSED_RESULT td::Status Torrent::Creator::add_file(td::Slice name, td::
}
td::Result<Torrent> Torrent::Creator::finalize() {
if (files_.empty()) {
return td::Status::Error("No files");
}
TorrentHeader header;
TRY_RESULT(files_count, td::narrow_cast_safe<td::uint32>(files_.size()));
header.files_count = files_count;