@@ -578,6 +578,7 @@ struct MsgHandleErrInternal {
578578 err: msgs::LightningError,
579579 closes_channel: bool,
580580 shutdown_finish: Option<(ShutdownResult, Option<msgs::ChannelUpdate>)>,
581+ payment_hash: Option<PaymentHash>
581582}
582583impl MsgHandleErrInternal {
583584 #[inline]
@@ -594,11 +595,12 @@ impl MsgHandleErrInternal {
594595 },
595596 closes_channel: false,
596597 shutdown_finish: None,
598+ payment_hash: None
597599 }
598600 }
599601 #[inline]
600602 fn from_no_close(err: msgs::LightningError) -> Self {
601- Self { err, closes_channel: false, shutdown_finish: None }
603+ Self { err, closes_channel: false, shutdown_finish: None, payment_hash: None }
602604 }
603605 #[inline]
604606 fn from_finish_shutdown(err: String, channel_id: ChannelId, shutdown_res: ShutdownResult, channel_update: Option<msgs::ChannelUpdate>) -> Self {
@@ -615,6 +617,7 @@ impl MsgHandleErrInternal {
615617 err: LightningError { err, action },
616618 closes_channel: true,
617619 shutdown_finish: Some((shutdown_res, channel_update)),
620+ payment_hash: None
618621 }
619622 }
620623 #[inline]
@@ -647,6 +650,7 @@ impl MsgHandleErrInternal {
647650 },
648651 closes_channel: false,
649652 shutdown_finish: None,
653+ payment_hash: None
650654 }
651655 }
652656
@@ -2683,14 +2687,14 @@ macro_rules! handle_error {
26832687
26842688 match $internal {
26852689 Ok(msg) => Ok(msg),
2686- Err(MsgHandleErrInternal { err, shutdown_finish, .. }) => {
2690+ Err(MsgHandleErrInternal { err, shutdown_finish, payment_hash, .. }) => {
26872691 let mut msg_event = None;
26882692
26892693 if let Some((shutdown_res, update_option)) = shutdown_finish {
26902694 let counterparty_node_id = shutdown_res.counterparty_node_id;
26912695 let channel_id = shutdown_res.channel_id;
26922696 let logger = WithContext::from(
2693- &$self.logger, Some(counterparty_node_id), Some(channel_id), None
2697+ &$self.logger, Some(counterparty_node_id), Some(channel_id), payment_hash
26942698 );
26952699 log_error!(logger, "Force-closing channel: {}", err.err);
26962700
0 commit comments