Skip to content

Commit f9ec65e

Browse files
committed
f more comments
1 parent c6233f6 commit f9ec65e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/util/persist.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,8 @@ where
848848
&self, monitor_name: MonitorName, monitor: &ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>,
849849
) {
850850
let inner = Arc::clone(&self.0);
851+
// Note that `persist_new_channel` is a sync method which calls all the way through to the
852+
// sync KVStore::write method (which returns a future) to ensure writes are well-ordered.
851853
let future = inner.persist_new_channel(monitor_name, monitor);
852854
let channel_id = monitor.channel_id();
853855
let completion = (monitor.channel_id(), monitor.get_latest_update_id());
@@ -869,6 +871,8 @@ where
869871
monitor: &ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>,
870872
) {
871873
let inner = Arc::clone(&self.0);
874+
// Note that `update_persisted_channel` is a sync method which calls all the way through to
875+
// the sync KVStore::write method (which returns a future) to ensure writes are well-ordered
872876
let future = inner.update_persisted_channel(monitor_name, update, monitor);
873877
let channel_id = monitor.channel_id();
874878
let completion = if let Some(update) = update {

0 commit comments

Comments
 (0)