7#include <bitcoin-build-config.h>
33 std::string strCmd =
gArgs.
GetArg(
"-alertnotify",
"");
34 if (strCmd.empty())
return;
39 std::string singleQuote(
"'");
41 safeStatus = singleQuote+safeStatus+singleQuote;
44 std::thread
t(runCommand, strCmd);
56 m_tip_block_cv.notify_all();
62 LogError(
"Failed to send shutdown signal after reaching stop height\n");
71 uiInterface.NotifyHeaderTip(state, height, timestamp, presync);
int64_t GetIntArg(const std::string &strArg, int64_t nDefault) const
Return integer argument or default value.
std::string GetArg(const std::string &strArg, const std::string &strDefault) const
Return string argument or default value.
The block chain is a tree shaped structure starting with the genesis block at the root,...
uint256 GetBlockHash() const
int nHeight
height of the entry in the chain. The genesis block has height 0
int m_stop_at_height
Block height after which blockTip notification will return Interrupted{}, if >0.
kernel::InterruptResult blockTip(SynchronizationState state, CBlockIndex &index) override EXCLUSIVE_LOCKS_REQUIRED(!m_tip_block_mutex)
const std::function< bool()> & m_shutdown_request
void headerTip(SynchronizationState state, int64_t height, int64_t timestamp, bool presync) override
std::atomic< int > & m_exit_status
void progress(const bilingual_str &title, int progress_percent, bool resume_possible) override
void warningSet(kernel::Warning id, const bilingual_str &message) override
node::Warnings & m_warnings
void fatalError(const bilingual_str &message) override
The fatal error notification is sent to notify the user when an error occurs in kernel code that can'...
void warningUnset(kernel::Warning id) override
bool m_shutdown_on_fatal_error
Useful for tests, can be set to false to avoid shutdown on fatal error.
void flushError(const bilingual_str &message) override
The flush error notification is sent to notify the user that an error occurred while flushing block d...
bool Unset(warning_type id) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Unset a warning message.
bool Set(warning_type id, bilingual_str message) EXCLUSIVE_LOCKS_REQUIRED(!m_mutex)
Set a warning message.
CClientUIInterface uiInterface
static void AlertNotify(const std::string &strMessage)
std::variant< std::monostate, Interrupted > InterruptResult
Simple result type for functions that need to propagate an interrupt status and don't have other retu...
void AbortNode(const std::function< bool()> &shutdown_request, std::atomic< int > &exit_status, const bilingual_str &message, node::Warnings *warnings)
void ReadNotificationArgs(const ArgsManager &args, KernelNotifications ¬ifications)
void ReplaceAll(std::string &in_out, const std::string &search, const std::string &substitute)
Result type for use with std::variant to indicate that an operation should be interrupted.
std::string SanitizeString(std::string_view str, int rule)
Remove unsafe chars.
SynchronizationState
Current sync state passed to tip changed callbacks.