diff --git a/src/main.rs b/src/main.rs index d1b5424..5308585 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1079,6 +1079,7 @@ async fn start_ldk() { tokio::spawn(sweep::migrate_deprecated_spendable_outputs( ldk_data_dir.clone(), Arc::clone(&keys_manager), + Arc::clone(&logger), Arc::clone(&persister), Arc::clone(&output_sweeper), )); diff --git a/src/sweep.rs b/src/sweep.rs index e13a2ab..15da689 100644 --- a/src/sweep.rs +++ b/src/sweep.rs @@ -4,11 +4,13 @@ use std::sync::Arc; use std::{fs, io}; use lightning::sign::{EntropySource, KeysManager, SpendableOutputDescriptor}; +use lightning::util::logger::Logger; use lightning::util::persist::KVStore; use lightning::util::ser::{Readable, WithoutLength, Writeable}; use lightning_persister::fs_store::FilesystemStore; +use crate::disk::FilesystemLogger; use crate::hex_utils; use crate::OutputSweeper; @@ -17,9 +19,10 @@ const DEPRECATED_PENDING_SPENDABLE_OUTPUT_DIR: &'static str = "pending_spendable /// We updated to use LDK's OutputSweeper as part of upgrading to LDK 0.0.123, so migrate away from /// the old sweep persistence. pub(crate) async fn migrate_deprecated_spendable_outputs( - ldk_data_dir: String, keys_manager: Arc, persister: Arc, - sweeper: Arc, + ldk_data_dir: String, keys_manager: Arc, logger: Arc, + persister: Arc, sweeper: Arc, ) { + lightning::log_info!(&*logger, "Beginning migration of deprecated spendable outputs"); let pending_spendables_dir = format!("{}/{}", ldk_data_dir, DEPRECATED_PENDING_SPENDABLE_OUTPUT_DIR); let processing_spendables_dir = format!("{}/processing_spendable_outputs", ldk_data_dir); @@ -82,4 +85,10 @@ pub(crate) async fn migrate_deprecated_spendable_outputs( fs::remove_dir_all(&spendables_dir).unwrap(); fs::remove_dir_all(&pending_spendables_dir).unwrap(); + + lightning::log_info!( + &*logger, + "Successfully migrated {} deprecated spendable outputs", + outputs.len() + ); }