From 6eb33bd0c21b3e075fbab596351cacafdc947472 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Tue, 9 May 2023 11:15:46 +0200 Subject: kernel: Add fatalError method to notifications FatalError replaces what previously was the AbortNode function in shutdown.cpp. This commit is part of the libbitcoinkernel project and further removes the shutdown's and, more generally, the kernel library's dependency on interface_ui with a kernel notification method. By removing interface_ui from the kernel library, its dependency on boost is reduced to just boost::multi_index. At the same time it also takes a step towards de-globalising the interrupt infrastructure. Co-authored-by: Russell Yanofsky Co-authored-by: TheCharlatan --- src/bitcoin-chainstate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/bitcoin-chainstate.cpp') diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index cb391e30de..c36233207e 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -101,7 +101,11 @@ int main(int argc, char* argv[]) { std::cerr << "Error flushing block data to disk: " << debug_message << std::endl; } - + void fatalError(const std::string& debug_message, const bilingual_str& user_message) override + { + std::cerr << "Error: " << debug_message << std::endl; + std::cerr << (user_message.empty() ? "A fatal internal error occurred." : user_message.original) << std::endl; + } }; auto notifications = std::make_unique(); -- cgit v1.2.3