Skip to content

Commit 8cdc86a

Browse files
authored
Merge pull request #4329 from TheBlueMatt/2026-01-actions-lock-assert
Add `total_consistency_lock` check in `handle_post_event_actions`
2 parents 7785360 + 8bdd1fa commit 8cdc86a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3438,6 +3438,10 @@ macro_rules! process_events_body {
34383438
}
34393439

34403440
if !post_event_actions.is_empty() {
3441+
// `handle_post_event_actions` may update channel state, so take the total
3442+
// consistency lock now similarly to other callers of `handle_post_event_actions`.
3443+
// Note that if it needs to wake the background processor for event handling or
3444+
// persistence it will do so directly.
34413445
let _read_guard = $self.total_consistency_lock.read().unwrap();
34423446
$self.handle_post_event_actions(post_event_actions);
34433447
// If we had some actions, go around again as we may have more events now
@@ -14315,6 +14319,10 @@ where
1431514319
}
1431614320

1431714321
fn handle_post_event_actions<I: IntoIterator<Item = EventCompletionAction>>(&self, actions: I) {
14322+
debug_assert_ne!(
14323+
self.total_consistency_lock.held_by_thread(),
14324+
LockHeldState::NotHeldByThread
14325+
);
1431814326
for action in actions.into_iter() {
1431914327
match action {
1432014328
EventCompletionAction::ReleaseRAAChannelMonitorUpdate {

0 commit comments

Comments
 (0)