#pragma once
namespace torlinkc {
// Crash-boot breaker for the restore path. A marker file is armed just before
// persisted state is handed to the torrent engine and disarmed once the boot
// has stayed alive long enough to be called healthy (or the app flushes state
// on a clean exit). Finding a marker at the next boot means the previous one
// died while restoring, so that boot restores everything paused and starts no
// engines -- the UI always comes up and the user resumes items on their own
// terms. Ported from download/bootguard.ts.
// How long (ms) after restore the process must survive before the marker is
// disarmed -- long enough for the engine's async startup to have blown up if
// it was going to.
inline constexpr int kBootSettleMs = 4000;
bool wasBootInterrupted();
void armBootMarker();
void disarmBootMarker();
} // namespace torlinkc