X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain.rs;h=9a5b62584b7383374bda67b6db322ae46dfe2248;hb=64d08ee85fe60b5d6e7a0773fe096a9c9ed38826;hp=d43bb9b26a4d500e7de303911cc33bb2c61c3858;hpb=f10f5c7c1d206f84c84bfbebf3add1be5e12b9cd;p=ldk-sample diff --git a/src/main.rs b/src/main.rs index d43bb9b..9a5b625 100644 --- a/src/main.rs +++ b/src/main.rs @@ -378,6 +378,10 @@ async fn start_ldk() { let ldk_data_dir = format!("{}/.ldk", args.ldk_storage_dir_path); fs::create_dir_all(ldk_data_dir.clone()).unwrap(); + // ## Setup + // Step 1: Initialize the Logger + let logger = Arc::new(FilesystemLogger::new(ldk_data_dir.clone())); + // Initialize our bitcoind client. let bitcoind_client = match BitcoindClient::new( args.bitcoind_rpc_host.clone(), @@ -385,6 +389,7 @@ async fn start_ldk() { args.bitcoind_rpc_username.clone(), args.bitcoind_rpc_password.clone(), tokio::runtime::Handle::current(), + Arc::clone(&logger), ) .await { @@ -411,15 +416,11 @@ async fn start_ldk() { return; } - // ## Setup - // Step 1: Initialize the FeeEstimator + // Step 2: Initialize the FeeEstimator // BitcoindClient implements the FeeEstimator trait, so it'll act as our fee estimator. let fee_estimator = bitcoind_client.clone(); - // Step 2: Initialize the Logger - let logger = Arc::new(FilesystemLogger::new(ldk_data_dir.clone())); - // Step 3: Initialize the BroadcasterInterface // BitcoindClient implements the BroadcasterInterface trait, so it'll act as our transaction