Skip to content

Commit 6d40ecf

Browse files
f add comment w/ warnings for users
1 parent 6bc46cc commit 6d40ecf

File tree

1 file changed

+10
-0
lines changed
  • lightning-data-persister/src

1 file changed

+10
-0
lines changed

lightning-data-persister/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ use std::marker::PhantomData;
1616

1717
/// FilesystemPersister can persist channel data on disk on Linux machines, where
1818
/// each channel's data is stored in a file named after its funding outpoint.
19+
///
20+
/// Warning: this module does the best it can with calls to persist data, but it
21+
/// can only guarantee that the data is passed to the drive. It is up to the
22+
/// drive manufacturers to do the actual persistence properly, which they often
23+
/// don't (especially on consumer-grade hardware). Therefore, it is up to the
24+
/// user to validate their entire storage stack, to ensure the writes are
25+
/// persistent.
26+
/// Corollary: especially when dealing with larger amounts of money, it is best
27+
/// practice to have multiple channel data backups and not rely only on the
28+
/// FilesystemPersister.
1929
pub struct FilesystemPersister<ChanSigner: ChannelKeys + Readable + Writeable> {
2030
path_to_channel_data: String,
2131
phantom: PhantomData<ChanSigner>, // TODO: is there a way around this?

0 commit comments

Comments
 (0)