Skip to content

Commit ab7fa89

Browse files
committed
f Also set/check processing flag for sync event processing
1 parent de89e26 commit ab7fa89

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5889,6 +5889,10 @@ where
58895889
/// An [`EventHandler`] may safely call back to the provider in order to handle an event.
58905890
/// However, it must not call [`Writeable::write`] as doing so would result in a deadlock.
58915891
fn process_pending_events<H: Deref>(&self, handler: H) where H::Target: EventHandler {
5892+
if self.pending_events_processor.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed).is_err() {
5893+
return;
5894+
}
5895+
58925896
PersistenceNotifierGuard::optionally_notify(&self.total_consistency_lock, &self.persistence_notifier, || {
58935897
let mut result = NotifyOption::SkipPersist;
58945898

@@ -5909,6 +5913,8 @@ where
59095913

59105914
result
59115915
});
5916+
5917+
self.pending_events_processor.store(false, Ordering::Release);
59125918
}
59135919
}
59145920

0 commit comments

Comments
 (0)