nautd: hash-check paused torrents (check-only worker)

A paused torrent never ran a worker, so it never verified on-disk data
and showed no progress. Add a one-shot check-only swarm mode (open +
resume scan + report, no peers/engine/download). The reconciler runs it
for a paused torrent flagged needs_check (set on paused-add and recheck);
the worker stays paused afterward. New TORRENT_CHECKING state -> webui
checkingDL/UP. Mark #11 done.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ookami125 2026-06-22 01:22:10 -04:00
parent 7bbc1ee22c
commit 4708db151d
5 changed files with 80 additions and 25 deletions

View file

@ -713,6 +713,18 @@ naut_err naut_swarm_run(const naut_swarm_config *config) {
naut_download_pieces_done(d), mi.num_pieces,
(unsigned long long)resumed_left);
/* Check-only: the resume scan above already hash-verified every piece on
* disk. Report the result and stop no peers, no engine, no download. */
if (config->check_only) {
report_progress(config, NULL, 0, d, &mi, tracker_stats, tracker_count,
now());
naut_download_destroy(d);
naut_storage_close(st);
naut_metainfo_free(&mi);
free(endpoints);
return NAUT_OK;
}
if (!from_magnet && config->num_peers == 0 && !naut_download_complete(d)) {
if (!discover_trackers(mi.infohash_v1, (uint64_t)mi.total_length,
mi.trackers, mi.num_trackers,