Skip to content

Commit 98b3870

Browse files
committed
f more comments
1 parent da932f6 commit 98b3870

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
@@ -841,6 +841,8 @@ where
841841
&self, monitor_name: MonitorName, monitor: &ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>,
842842
) {
843843
let inner = Arc::clone(&self.0);
844+
// Note that `persist_new_channel` is a sync method which calls all the way through to the
845+
// sync KVStore::write method (which returns a future) to ensure writes are well-ordered.
844846
let future = inner.persist_new_channel(monitor_name, monitor);
845847
let channel_id = monitor.channel_id();
846848
let completion = (monitor.channel_id(), monitor.get_latest_update_id());
@@ -862,6 +864,8 @@ where
862864
monitor: &ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>,
863865
) {
864866
let inner = Arc::clone(&self.0);
867+
// Note that `update_persisted_channel` is a sync method which calls all the way through to
868+
// the sync KVStore::write method (which returns a future) to ensure writes are well-ordered
865869
let future = inner.update_persisted_channel(monitor_name, update, monitor);
866870
let channel_id = monitor.channel_id();
867871
let completion = if let Some(update) = update {

0 commit comments

Comments
 (0)