@@ -242,6 +242,7 @@ type ShutdownResult = (Option<(OutPoint, ChannelMonitorUpdate)>, Vec<(HTLCSource
242
242
243
243
struct MsgHandleErrInternal {
244
244
err : msgs:: LightningError ,
245
+ chan_id : Option < [ u8 ; 32 ] > , // If Some a channel of ours has been closed
245
246
shutdown_finish : Option < ( ShutdownResult , Option < msgs:: ChannelUpdate > ) > ,
246
247
}
247
248
impl MsgHandleErrInternal {
@@ -257,6 +258,7 @@ impl MsgHandleErrInternal {
257
258
} ,
258
259
} ,
259
260
} ,
261
+ chan_id : None ,
260
262
shutdown_finish : None ,
261
263
}
262
264
}
@@ -267,12 +269,13 @@ impl MsgHandleErrInternal {
267
269
err,
268
270
action : msgs:: ErrorAction :: IgnoreError ,
269
271
} ,
272
+ chan_id : None ,
270
273
shutdown_finish : None ,
271
274
}
272
275
}
273
276
#[ inline]
274
277
fn from_no_close ( err : msgs:: LightningError ) -> Self {
275
- Self { err, shutdown_finish : None }
278
+ Self { err, chan_id : None , shutdown_finish : None }
276
279
}
277
280
#[ inline]
278
281
fn from_finish_shutdown ( err : String , channel_id : [ u8 ; 32 ] , shutdown_res : ShutdownResult , channel_update : Option < msgs:: ChannelUpdate > ) -> Self {
@@ -286,6 +289,7 @@ impl MsgHandleErrInternal {
286
289
} ,
287
290
} ,
288
291
} ,
292
+ chan_id : Some ( channel_id) ,
289
293
shutdown_finish : Some ( ( shutdown_res, channel_update) ) ,
290
294
}
291
295
}
@@ -320,6 +324,7 @@ impl MsgHandleErrInternal {
320
324
} ,
321
325
} ,
322
326
} ,
327
+ chan_id : None ,
323
328
shutdown_finish : None ,
324
329
}
325
330
}
@@ -813,7 +818,7 @@ macro_rules! handle_error {
813
818
( $self: ident, $internal: expr, $counterparty_node_id: expr) => {
814
819
match $internal {
815
820
Ok ( msg) => Ok ( msg) ,
816
- Err ( MsgHandleErrInternal { err, shutdown_finish } ) => {
821
+ Err ( MsgHandleErrInternal { err, chan_id , shutdown_finish } ) => {
817
822
#[ cfg( debug_assertions) ]
818
823
{
819
824
// In testing, ensure there are no deadlocks where the lock is already held upon
0 commit comments