Skip to content

Commit 2a37aac

Browse files
committed
Improve + fix indentation in lightning-persister/src/lib.rs
1 parent 2df81a7 commit 2a37aac

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

lightning-persister/src/lib.rs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ impl<Signer: Sign> DiskWriteable for ChannelMonitor<Signer> {
5353
}
5454

5555
impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> DiskWriteable for ChannelManager<Signer, M, T, K, F, L>
56-
where M::Target: chain::Watch<Signer>,
57-
T::Target: BroadcasterInterface,
58-
K::Target: KeysInterface<Signer=Signer>,
59-
F::Target: FeeEstimator,
60-
L::Target: Logger
56+
where
57+
M::Target: chain::Watch<Signer>,
58+
T::Target: BroadcasterInterface,
59+
K::Target: KeysInterface<Signer=Signer>,
60+
F::Target: FeeEstimator,
61+
L::Target: Logger
6162
{
6263
fn write_to_file(&self, writer: &mut fs::File) -> Result<(), std::io::Error> {
6364
self.write(writer)
@@ -90,11 +91,12 @@ impl FilesystemPersister {
9091
data_dir: String,
9192
manager: &ChannelManager<Signer, M, T, K, F, L>
9293
) -> Result<(), std::io::Error>
93-
where M::Target: chain::Watch<Signer>,
94-
T::Target: BroadcasterInterface,
95-
K::Target: KeysInterface<Signer=Signer>,
96-
F::Target: FeeEstimator,
97-
L::Target: Logger
94+
where
95+
M::Target: chain::Watch<Signer>,
96+
T::Target: BroadcasterInterface,
97+
K::Target: KeysInterface<Signer=Signer>,
98+
F::Target: FeeEstimator,
99+
L::Target: Logger
98100
{
99101
let path = PathBuf::from(data_dir);
100102
util::write_to_file(path, "manager".to_string(), manager)
@@ -106,7 +108,7 @@ impl FilesystemPersister {
106108
pub fn read_channelmonitors<Signer: Sign, K: Deref> (
107109
&self, keys_manager: K
108110
) -> Result<HashMap<OutPoint, (BlockHash, ChannelMonitor<Signer>)>, std::io::Error>
109-
where K::Target: KeysInterface<Signer=Signer> + Sized
111+
where K::Target: KeysInterface<Signer=Signer> + Sized
110112
{
111113
let path = self.path_to_monitor_data();
112114
if !Path::new(&path).exists() {
@@ -163,13 +165,13 @@ impl<ChannelSigner: Sign> channelmonitor::Persist<ChannelSigner> for FilesystemP
163165
fn persist_new_channel(&self, funding_txo: OutPoint, monitor: &ChannelMonitor<ChannelSigner>) -> Result<(), ChannelMonitorUpdateErr> {
164166
let filename = format!("{}_{}", funding_txo.txid.to_hex(), funding_txo.index);
165167
util::write_to_file(self.path_to_monitor_data(), filename, monitor)
166-
.map_err(|_| ChannelMonitorUpdateErr::PermanentFailure)
168+
.map_err(|_| ChannelMonitorUpdateErr::PermanentFailure)
167169
}
168170

169171
fn update_persisted_channel(&self, funding_txo: OutPoint, _update: &ChannelMonitorUpdate, monitor: &ChannelMonitor<ChannelSigner>) -> Result<(), ChannelMonitorUpdateErr> {
170172
let filename = format!("{}_{}", funding_txo.txid.to_hex(), funding_txo.index);
171173
util::write_to_file(self.path_to_monitor_data(), filename, monitor)
172-
.map_err(|_| ChannelMonitorUpdateErr::PermanentFailure)
174+
.map_err(|_| ChannelMonitorUpdateErr::PermanentFailure)
173175
}
174176
}
175177

0 commit comments

Comments
 (0)