aboutsummaryrefslogtreecommitdiff
path: root/src/util/signalinterrupt.cpp
AgeCommit message (Collapse)Author
2023-12-04util: Get rid of uncaught exceptions thrown by SignalInterrupt classRyan Ofsky
Replace exceptions thrown by signal and wait methods with [[nodiscard]] return values. This is mostly a refactoring, but there is a slight change of behavior if AbortShutdown function fails. The original behavior which was unintentionally changed in #27861 is restored, so it now triggers an assert failure again instead of throwing an exception. (The AbortShutdown function is only ever called in the the GUI version of Bitcoin Core when corruption is detected on loading and the user tries to reindex.) Problems with using exceptions were pointed out by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/27861#discussion_r1255496707.
2023-06-28util: Add SignalInterrupt class and use in shutdown.cppTheCharlatan
This change helps generalize shutdown code so an interrupt can be provided to libbitcoinkernel callers. This may also be useful to eventually de-globalize all of the shutdown code. Co-authored-by: Russell Yanofsky <russ@yanofsky.org> Co-authored-by: TheCharlatan <seb.kung@gmail.com>