@@ -572,6 +572,7 @@ struct MsgHandleErrInternal {
572
572
err: msgs::LightningError,
573
573
closes_channel: bool,
574
574
shutdown_finish: Option<(ShutdownResult, Option<msgs::ChannelUpdate>)>,
575
+ payment_hash: Option<PaymentHash>
575
576
}
576
577
impl MsgHandleErrInternal {
577
578
#[inline]
@@ -588,11 +589,12 @@ impl MsgHandleErrInternal {
588
589
},
589
590
closes_channel: false,
590
591
shutdown_finish: None,
592
+ payment_hash: None
591
593
}
592
594
}
593
595
#[inline]
594
596
fn from_no_close(err: msgs::LightningError) -> Self {
595
- Self { err, closes_channel: false, shutdown_finish: None }
597
+ Self { err, closes_channel: false, shutdown_finish: None, payment_hash: None }
596
598
}
597
599
#[inline]
598
600
fn from_finish_shutdown(err: String, channel_id: ChannelId, shutdown_res: ShutdownResult, channel_update: Option<msgs::ChannelUpdate>) -> Self {
@@ -609,6 +611,7 @@ impl MsgHandleErrInternal {
609
611
err: LightningError { err, action },
610
612
closes_channel: true,
611
613
shutdown_finish: Some((shutdown_res, channel_update)),
614
+ payment_hash: None
612
615
}
613
616
}
614
617
#[inline]
@@ -641,6 +644,7 @@ impl MsgHandleErrInternal {
641
644
},
642
645
closes_channel: false,
643
646
shutdown_finish: None,
647
+ payment_hash: None
644
648
}
645
649
}
646
650
@@ -2021,14 +2025,14 @@ macro_rules! handle_error {
2021
2025
2022
2026
match $internal {
2023
2027
Ok(msg) => Ok(msg),
2024
- Err(MsgHandleErrInternal { err, shutdown_finish, .. }) => {
2028
+ Err(MsgHandleErrInternal { err, shutdown_finish, payment_hash, .. }) => {
2025
2029
let mut msg_event = None;
2026
2030
2027
2031
if let Some((shutdown_res, update_option)) = shutdown_finish {
2028
2032
let counterparty_node_id = shutdown_res.counterparty_node_id;
2029
2033
let channel_id = shutdown_res.channel_id;
2030
2034
let logger = WithContext::from(
2031
- &$self.logger, Some(counterparty_node_id), Some(channel_id), None
2035
+ &$self.logger, Some(counterparty_node_id), Some(channel_id), payment_hash
2032
2036
);
2033
2037
log_error!(logger, "Force-closing channel: {}", err.err);
2034
2038
0 commit comments