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