Pass network

This commit is contained in:
Gregor Reitzenstein 2020-12-15 13:04:03 +01:00
parent 6d5802c0a5
commit 7b5d8de93f
2 changed files with 4 additions and 2 deletions

View File

@ -176,7 +176,7 @@ fn maybe(matches: clap::ArgMatches, log: Arc<Logger>) -> 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.
}
}

View File

@ -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<Logger>, config: Settings, db: Databases) -> Result<(), Error> {
pub fn serve_api_connections(log: Arc<Logger>, config: Settings, db: Databases, nw: Network)
-> Result<(), Error>
{
let signal = Box::pin(async {
let (tx, mut rx) = UnixStream::pair()?;
// Initialize signal handler.