@@ -4472,20 +4472,34 @@ where
4472
4472
chan_id: &[u8; 32],
4473
4473
chan_context: &mut ChannelContext<<SP::Target as SignerProvider>::Signer>,
4474
4474
unfunded_chan_context: &mut UnfundedChannelContext,
4475
+ pending_msg_events: &mut Vec<MessageSendEvent>,
4475
4476
| {
4476
4477
chan_context.maybe_expire_prev_config();
4477
4478
if unfunded_chan_context.should_expire_unfunded_channel() {
4478
- log_error!(self.logger, "Force-closing pending outbound channel {} for not establishing in a timely manner", log_bytes!(&chan_id[..]));
4479
+ log_error!(self.logger,
4480
+ "Force-closing pending channel with ID {} for not establishing in a timely manner",
4481
+ log_bytes!(&chan_id[..]));
4479
4482
update_maps_on_chan_removal!(self, &chan_context);
4480
4483
self.issue_channel_close_events(&chan_context, ClosureReason::HolderForceClosed);
4481
4484
self.finish_force_close_channel(chan_context.force_shutdown(false));
4485
+ pending_msg_events.push(MessageSendEvent::HandleError {
4486
+ node_id: counterparty_node_id,
4487
+ action: msgs::ErrorAction::SendErrorMessage {
4488
+ msg: msgs::ErrorMessage {
4489
+ channel_id: *chan_id,
4490
+ data: "Force-closing pending channel due to timeout awaiting establishment handshake".to_owned(),
4491
+ },
4492
+ },
4493
+ });
4482
4494
false
4483
4495
} else {
4484
4496
true
4485
4497
}
4486
4498
};
4487
- peer_state.outbound_v1_channel_by_id.retain(|chan_id, chan| process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context));
4488
- peer_state.inbound_v1_channel_by_id.retain(|chan_id, chan| process_unfunded_channel_tick(chan_id, &mut chan.context, &mut chan.unfunded_context));
4499
+ peer_state.outbound_v1_channel_by_id.retain(|chan_id, chan| process_unfunded_channel_tick(
4500
+ chan_id, &mut chan.context, &mut chan.unfunded_context, pending_msg_events));
4501
+ peer_state.inbound_v1_channel_by_id.retain(|chan_id, chan| process_unfunded_channel_tick(
4502
+ chan_id, &mut chan.context, &mut chan.unfunded_context, pending_msg_events));
4489
4503
4490
4504
if peer_state.ok_to_remove(true) {
4491
4505
pending_peers_awaiting_removal.push(counterparty_node_id);
0 commit comments