diff --git a/src/bin/darkfid.rs b/src/bin/darkfid.rs index f2ed6020e..7c7449c00 100644 --- a/src/bin/darkfid.rs +++ b/src/bin/darkfid.rs @@ -244,8 +244,9 @@ fn main() -> Result<()> { ]) .unwrap(); - let adapter = RpcAdapter::new("wallet.db")?; + debug!(target: "DARKFID", "main() [ADAPTER CREATED]"); let ex2 = ex.clone(); + let adapter = RpcAdapter::new("wallet.db")?; let (_, result) = Parallel::new() // Run four executor threads. diff --git a/src/rpc/adapter.rs b/src/rpc/adapter.rs index 145c36143..b534541cb 100644 --- a/src/rpc/adapter.rs +++ b/src/rpc/adapter.rs @@ -11,6 +11,7 @@ pub struct RpcAdapter { impl RpcAdapter { pub fn new(dbname: &str) -> Result { + debug!(target: "ADAPTER", "new() [CREATING NEW WALLET]"); let wallet = WalletDB::new(dbname)?; Ok(Self { wallet }) } diff --git a/src/rpc/jsonserver.rs b/src/rpc/jsonserver.rs index 1383b6130..6dd7dd746 100644 --- a/src/rpc/jsonserver.rs +++ b/src/rpc/jsonserver.rs @@ -74,9 +74,9 @@ pub async fn listen( pub async fn start( executor: Arc>, options: Arc, - _adapter: RpcAdapter, + adapter: RpcAdapter, ) -> Result<()> { - let rpc = RpcInterface::new()?; + let rpc = RpcInterface::new(adapter)?; let http = listen( executor.clone(), rpc.clone(), @@ -104,9 +104,8 @@ pub struct RpcInterface { } impl RpcInterface { - pub fn new() -> Result> { + pub fn new(adapter: RpcAdapter) -> Result> { let (stop_send, stop_recv) = async_channel::unbounded::<()>(); - let adapter = RpcAdapter::new("wallet.db")?; Ok(Arc::new(Self { //p2p, started: Mutex::new(false),