From: Matt Corallo Date: Mon, 12 Apr 2021 16:20:38 +0000 (-0400) Subject: Expand persistence to all ChannelManagers, not just Arc-based ones X-Git-Tag: v0.0.14~29^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=0a11eb19ab8922dae6a827192d65661265d516e4;p=rust-lightning Expand persistence to all ChannelManagers, not just Arc-based ones --- diff --git a/lightning-persister/src/lib.rs b/lightning-persister/src/lib.rs index 368945d1c..8effedbce 100644 --- a/lightning-persister/src/lib.rs +++ b/lightning-persister/src/lib.rs @@ -29,7 +29,6 @@ use std::fs; use std::io::{Cursor, Error}; use std::ops::Deref; use std::path::{Path, PathBuf}; -use std::sync::Arc; /// FilesystemPersister persists channel data on disk, where each channel's /// data is stored in a file named after its funding outpoint. @@ -53,12 +52,12 @@ impl DiskWriteable for ChannelMonitor { } } -impl DiskWriteable for ChannelManager, Arc, Arc, Arc, Arc> -where M: chain::Watch, - T: BroadcasterInterface, - K: KeysInterface, - F: FeeEstimator, - L: Logger, +impl DiskWriteable for ChannelManager +where M::Target: chain::Watch, + T::Target: BroadcasterInterface, + K::Target: KeysInterface, + F::Target: FeeEstimator, + L::Target: Logger { fn write_to_file(&self, writer: &mut fs::File) -> Result<(), std::io::Error> { self.write(writer) @@ -87,16 +86,15 @@ impl FilesystemPersister { /// Writes the provided `ChannelManager` to the path provided at `FilesystemPersister` /// initialization, within a file called "manager". - pub fn persist_manager( + pub fn persist_manager( data_dir: String, - manager: &ChannelManager, Arc, Arc, Arc, Arc> + manager: &ChannelManager ) -> Result<(), std::io::Error> - where Signer: Sign, - M: chain::Watch, - T: BroadcasterInterface, - K: KeysInterface, - F: FeeEstimator, - L: Logger + where M::Target: chain::Watch, + T::Target: BroadcasterInterface, + K::Target: KeysInterface, + F::Target: FeeEstimator, + L::Target: Logger { let path = PathBuf::from(data_dir); util::write_to_file(path, "manager".to_string(), manager)