@@ -577,6 +577,7 @@ struct MsgHandleErrInternal {
577577 err: msgs::LightningError,
578578 closes_channel: bool,
579579 shutdown_finish: Option<(ShutdownResult, Option<msgs::ChannelUpdate>)>,
580+ payment_hash: Option<PaymentHash>
580581}
581582impl MsgHandleErrInternal {
582583 #[inline]
@@ -593,11 +594,12 @@ impl MsgHandleErrInternal {
593594 },
594595 closes_channel: false,
595596 shutdown_finish: None,
597+ payment_hash: None
596598 }
597599 }
598600 #[inline]
599601 fn from_no_close(err: msgs::LightningError) -> Self {
600- Self { err, closes_channel: false, shutdown_finish: None }
602+ Self { err, closes_channel: false, shutdown_finish: None, payment_hash: None }
601603 }
602604 #[inline]
603605 fn from_finish_shutdown(err: String, channel_id: ChannelId, shutdown_res: ShutdownResult, channel_update: Option<msgs::ChannelUpdate>) -> Self {
@@ -614,6 +616,7 @@ impl MsgHandleErrInternal {
614616 err: LightningError { err, action },
615617 closes_channel: true,
616618 shutdown_finish: Some((shutdown_res, channel_update)),
619+ payment_hash: None
617620 }
618621 }
619622 #[inline]
@@ -646,6 +649,7 @@ impl MsgHandleErrInternal {
646649 },
647650 closes_channel: false,
648651 shutdown_finish: None,
652+ payment_hash: None
649653 }
650654 }
651655
@@ -2682,14 +2686,14 @@ macro_rules! handle_error {
26822686
26832687 match $internal {
26842688 Ok(msg) => Ok(msg),
2685- Err(MsgHandleErrInternal { err, shutdown_finish, .. }) => {
2689+ Err(MsgHandleErrInternal { err, shutdown_finish, payment_hash, .. }) => {
26862690 let mut msg_event = None;
26872691
26882692 if let Some((shutdown_res, update_option)) = shutdown_finish {
26892693 let counterparty_node_id = shutdown_res.counterparty_node_id;
26902694 let channel_id = shutdown_res.channel_id;
26912695 let logger = WithContext::from(
2692- &$self.logger, Some(counterparty_node_id), Some(channel_id), None
2696+ &$self.logger, Some(counterparty_node_id), Some(channel_id), payment_hash
26932697 );
26942698 log_error!(logger, "Force-closing channel: {}", err.err);
26952699
0 commit comments