@@ -3105,18 +3105,7 @@ macro_rules! handle_error {
3105
3105
} };
3106
3106
}
3107
3107
3108
- /// When a channel is removed, two things need to happen:
3109
- /// (a) This must be called in the same `per_peer_state` lock as the channel-closing action,
3110
- /// (b) [`ChannelManager::finish_close_channel`] needs to be called without holding any locks
3111
- /// (except [`ChannelManager::total_consistency_lock`].
3112
- ///
3113
- /// Note that this step can be skipped if the channel was never opened (through the creation of a
3114
- /// [`ChannelMonitor`]/channel funding transaction) to begin with.
3115
- ///
3116
- /// For non-coop-close cases, you should generally prefer to call `convert_channel_err` and
3117
- /// [`handle_error`] instead (which delegate to this and [`ChannelManager::finish_close_channel`]),
3118
- /// as they ensure the relevant messages go out as well. In a coop close case, calling this
3119
- /// directly avoids duplicate error messages.
3108
+ /// Do not call this directly, use `convert_channel_err` instead.
3120
3109
#[rustfmt::skip]
3121
3110
macro_rules! locked_close_channel {
3122
3111
($self: ident, $chan_context: expr, UNFUNDED) => {{
@@ -3164,7 +3153,18 @@ macro_rules! locked_close_channel {
3164
3153
}}
3165
3154
}
3166
3155
3167
- /// Returns (boolean indicating if we should remove the Channel object from memory, a mapped error)
3156
+ /// When a channel is removed, two things need to happen:
3157
+ /// (a) This must be called in the same `per_peer_state` lock as the channel-closing action,
3158
+ /// (b) [`handle_error`] needs to be called without holding any locks (except
3159
+ /// [`ChannelManager::total_consistency_lock`]), which then calls
3160
+ /// [`ChannelManager::finish_close_channel`].
3161
+ ///
3162
+ /// Note that this step can be skipped if the channel was never opened (through the creation of a
3163
+ /// [`ChannelMonitor`]/channel funding transaction) to begin with.
3164
+ ///
3165
+ /// Returns `(boolean indicating if we should remove the Channel object from memory, a mapped
3166
+ /// error)`, except in the `COOP_CLOSE` case, where the bool is elided (it is always implicitly
3167
+ /// true).
3168
3168
#[rustfmt::skip]
3169
3169
macro_rules! convert_channel_err {
3170
3170
($self: ident, $peer_state: expr, $err: expr, $chan: expr, $close: expr, $locked_close: expr, $channel_id: expr, _internal) => { {
@@ -4235,13 +4235,10 @@ where
4235
4235
}
4236
4236
4237
4237
/// When a channel is removed, two things need to happen:
4238
- /// (a) [`locked_close_channel`] must be called in the same `per_peer_state` lock as
4239
- /// the channel-closing action,
4240
- /// (b) this needs to be called without holding any locks (except
4241
- /// [`ChannelManager::total_consistency_lock`].
4242
- ///
4243
- /// In non-coop-close cases, this is generally accomplished by calling [`convert_channel_err`]
4244
- /// followed by [`handle_error`].
4238
+ /// (a) [`convert_channel_err`] must be called in the same `per_peer_state` lock as the
4239
+ /// channel-closing action,
4240
+ /// (b) [`handle_error`] needs to be called without holding any locks (except
4241
+ /// [`ChannelManager::total_consistency_lock`]), which then calls this.
4245
4242
#[rustfmt::skip]
4246
4243
fn finish_close_channel(&self, mut shutdown_res: ShutdownResult) {
4247
4244
debug_assert_ne!(self.per_peer_state.held_by_thread(), LockHeldState::HeldByThread);
0 commit comments