8#include <config/bitcoin-config.h>
17#include <condition_variable>
25 _(
"A fatal internal error occurred, see debug.log for details");
69 LogPrintf(
"Sending shutdown token failed\n");
96 LogPrintf(
"Reading shutdown token failed\n");
int TokenWrite(uint8_t token)
Write token to endpoint.
int TokenRead()
Read token from endpoint.
static std::optional< TokenPipe > Make()
Create a new pipe.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
void WaitForShutdown()
Wait for StartShutdown to be called in any thread.
static TokenPipeEnd g_shutdown_w
bool AbortNode(const std::string &strMessage, bilingual_str user_message)
Abort with a message.
bool ShutdownRequested()
Returns true if a shutdown is requested, false otherwise.
static std::atomic< bool > fRequestShutdown(false)
static TokenPipeEnd g_shutdown_r
On UNIX-like operating systems use the self-pipe trick.
bool InitShutdownState()
Initialize shutdown state.
void StartShutdown()
Request shutdown of the application.
void AbortShutdown()
Clear shutdown flag.
bilingual_str _(const char *psz)
Translation function.
bilingual_str Untranslated(std::string original)
Mark a bilingual_str as untranslated.
constexpr auto AbortError
void SetMiscWarning(const bilingual_str &warning)