@@ -92,17 +92,20 @@ impl MonitorUpdateId {
92
92
/// closed without broadcasting the latest state. See
93
93
/// [`ChannelMonitorUpdateErr::PermanentFailure`] for more details.
94
94
pub trait Persist < ChannelSigner : Sign > {
95
- /// Persist a new channel's data. The data can be stored any way you want, but the identifier
96
- /// provided by LDK is the channel's outpoint (and it is up to you to maintain a correct
97
- /// mapping between the outpoint and the stored channel data). Note that you **must** persist
98
- /// every new monitor to disk.
95
+ /// Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
96
+ /// called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
97
+ ///
98
+ /// The data can be stored any way you want, but the identifier provided by LDK is the
99
+ /// channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
100
+ /// and the stored channel data). Note that you **must** persist every new monitor to disk.
99
101
///
100
102
/// The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
101
103
/// if you return [`ChannelMonitorUpdateErr::TemporaryFailure`].
102
104
///
103
105
/// See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
104
106
/// and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
105
107
///
108
+ /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
106
109
/// [`Writeable::write`]: crate::util::ser::Writeable::write
107
110
fn persist_new_channel ( & self , channel_id : OutPoint , data : & ChannelMonitor < ChannelSigner > , update_id : MonitorUpdateId ) -> Result < ( ) , ChannelMonitorUpdateErr > ;
108
111
0 commit comments