Skip to content

Commit 4b3713f

Browse files
committed
f more comments
1 parent 139ceb0 commit 4b3713f

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
@@ -863,6 +863,8 @@ where
863863
monitor: &ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>,
864864
) {
865865
let inner = Arc::clone(&self.0);
866+
// Note that `persist_new_channel` is a sync method which calls all the way through to the
867+
// sync KVStore::write method (which returns a future) to ensure writes are well-ordered.
866868
let future = inner.persist_new_channel(monitor_name, monitor);
867869
let channel_id = monitor.channel_id();
868870
let completion = (monitor.channel_id(), monitor.get_latest_update_id());
@@ -884,6 +886,8 @@ where
884886
monitor: &ChannelMonitor<<SP::Target as SignerProvider>::EcdsaSigner>,
885887
) {
886888
let inner = Arc::clone(&self.0);
889+
// Note that `update_persisted_channel` is a sync method which calls all the way through to
890+
// the sync KVStore::write method (which returns a future) to ensure writes are well-ordered
887891
let future = inner.update_persisted_channel(monitor_name, update, monitor);
888892
let channel_id = monitor.channel_id();
889893
let completion = if let Some(update) = update {

0 commit comments

Comments
 (0)