Skip to content

Commit

Permalink
lib: remove the panic hook.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
darosior committed Mar 20, 2024
1 parent b4fe963 commit f6ce85c
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -60,8 +60,6 @@ fn setup_panic_hook() {
info,
bt
);

process::exit(1);
}));
}

Expand Down Expand Up @@ -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<impl BitcoinInterface + 'static>,
Expand Down

0 comments on commit f6ce85c

Please sign in to comment.