diff --git a/src/main.rs b/src/main.rs index 0bb1961..5c279b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -176,7 +176,7 @@ fn maybe(matches: clap::ArgMatches, log: Arc) -> Result<(), Error> { // TODO: Spawn api connections on their own (non-main) thread, use the main thread to // handle signals (a cli if stdin is not closed?) and make it stop and clean up all threads // when bffh should exit - server::serve_api_connections(log.clone(), config, db) + server::serve_api_connections(log.clone(), config, db, network) // Signal is dropped here, stopping all executor threads as well. } } diff --git a/src/server.rs b/src/server.rs index fede905..4828733 100644 --- a/src/server.rs +++ b/src/server.rs @@ -27,7 +27,9 @@ use std::sync::Arc; use crate::db::Databases; /// Handle all API connections and run the RPC tasks spawned from that on the local thread. -pub fn serve_api_connections(log: Arc, config: Settings, db: Databases) -> Result<(), Error> { +pub fn serve_api_connections(log: Arc, config: Settings, db: Databases, nw: Network) + -> Result<(), Error> +{ let signal = Box::pin(async { let (tx, mut rx) = UnixStream::pair()?; // Initialize signal handler.