+ #[cfg(debug_assertions)]
+ {
+ // In testing, we always lock here to ensure there are no deadlocks where we
+ // were holding the lock coming into the macro but didn't catch it because we
+ // didn't generate an action and didn't have any HTLCs to fail backwards in the
+ // finish_force_close_channel.
+ if channel_state.is_none() {
+ channel_state = Some($self.channel_state.lock().unwrap());
+ }
+ }