@@ -3309,6 +3309,11 @@ macro_rules! handle_monitor_update_completion {
3309
3309
} }
3310
3310
}
3311
3311
3312
+ #[cfg(not(any(test, feature = "_externalize_tests")))]
3313
+ const SYNC_UPDATE: usize = 1;
3314
+ #[cfg(not(any(test, feature = "_externalize_tests")))]
3315
+ const ASYNC_UPDATE: usize = 2;
3316
+
3312
3317
macro_rules! handle_new_monitor_update {
3313
3318
($self: ident, $update_res: expr, $logger: expr, $channel_id: expr, _internal, $completed: expr) => { {
3314
3319
debug_assert!($self.background_events_processed_since_startup.load(Ordering::Acquire));
@@ -3320,7 +3325,7 @@ macro_rules! handle_new_monitor_update {
3320
3325
},
3321
3326
ChannelMonitorUpdateStatus::InProgress => {
3322
3327
#[cfg(not(any(test, feature = "_externalize_tests")))]
3323
- if $self.monitor_update_type.swap(1 , Ordering::Relaxed) == 2 {
3328
+ if $self.monitor_update_type.swap(ASYNC_UPDATE , Ordering::Relaxed) == SYNC_UPDATE {
3324
3329
panic!("Cannot use both ChannelMonitorUpdateStatus modes InProgress and Completed without restart");
3325
3330
}
3326
3331
log_debug!($logger, "ChannelMonitor update for {} in flight, holding messages until the update completes.",
@@ -3329,7 +3334,7 @@ macro_rules! handle_new_monitor_update {
3329
3334
},
3330
3335
ChannelMonitorUpdateStatus::Completed => {
3331
3336
#[cfg(not(any(test, feature = "_externalize_tests")))]
3332
- if $self.monitor_update_type.swap(2 , Ordering::Relaxed) == 1 {
3337
+ if $self.monitor_update_type.swap(SYNC_UPDATE , Ordering::Relaxed) == ASYNC_UPDATE {
3333
3338
panic!("Cannot use both ChannelMonitorUpdateStatus modes InProgress and Completed without restart");
3334
3339
}
3335
3340
$completed;
0 commit comments