From f6ce85cfd32f669f6eb061ed8b367f4182512b95 Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Thu, 14 Mar 2024 17:53:16 +0100 Subject: [PATCH] lib: remove the panic hook. We now provide a way for a user of the daemon to poll for errors in the threads, so aborting the process on a thread panic shouldn't be necessary anymore. --- src/lib.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 163c14be0..4b57b1905 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,7 +33,7 @@ use std::{error, fmt, fs, io, path, sync, thread}; use miniscript::bitcoin::secp256k1; #[cfg(not(test))] -use std::{panic, process}; +use std::panic; // A panic in any thread should stop the main thread, and print the panic. #[cfg(not(test))] fn setup_panic_hook() { @@ -60,8 +60,6 @@ fn setup_panic_hook() { info, bt ); - - process::exit(1); })); } @@ -309,9 +307,6 @@ impl DaemonHandle { /// default Bitcoin interface (`bitcoind` JSONRPC) will be used. /// You may specify a custom Database interface through the `db` parameter. If `None`, the /// default Database interface (SQLite) will be used. - /// - /// **Note**: we internally use threads, and set a panic hook. A downstream application must - /// not overwrite this panic hook. pub fn start( config: Config, bitcoin: Option,