@@ -578,6 +578,7 @@ struct MsgHandleErrInternal {
578
578
err: msgs::LightningError,
579
579
closes_channel: bool,
580
580
shutdown_finish: Option<(ShutdownResult, Option<msgs::ChannelUpdate>)>,
581
+ payment_hash: Option<PaymentHash>
581
582
}
582
583
impl MsgHandleErrInternal {
583
584
#[inline]
@@ -594,11 +595,12 @@ impl MsgHandleErrInternal {
594
595
},
595
596
closes_channel: false,
596
597
shutdown_finish: None,
598
+ payment_hash: None
597
599
}
598
600
}
599
601
#[inline]
600
602
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 }
602
604
}
603
605
#[inline]
604
606
fn from_finish_shutdown(err: String, channel_id: ChannelId, shutdown_res: ShutdownResult, channel_update: Option<msgs::ChannelUpdate>) -> Self {
@@ -615,6 +617,7 @@ impl MsgHandleErrInternal {
615
617
err: LightningError { err, action },
616
618
closes_channel: true,
617
619
shutdown_finish: Some((shutdown_res, channel_update)),
620
+ payment_hash: None
618
621
}
619
622
}
620
623
#[inline]
@@ -647,6 +650,7 @@ impl MsgHandleErrInternal {
647
650
},
648
651
closes_channel: false,
649
652
shutdown_finish: None,
653
+ payment_hash: None
650
654
}
651
655
}
652
656
@@ -2683,14 +2687,14 @@ macro_rules! handle_error {
2683
2687
2684
2688
match $internal {
2685
2689
Ok(msg) => Ok(msg),
2686
- Err(MsgHandleErrInternal { err, shutdown_finish, .. }) => {
2690
+ Err(MsgHandleErrInternal { err, shutdown_finish, payment_hash, .. }) => {
2687
2691
let mut msg_event = None;
2688
2692
2689
2693
if let Some((shutdown_res, update_option)) = shutdown_finish {
2690
2694
let counterparty_node_id = shutdown_res.counterparty_node_id;
2691
2695
let channel_id = shutdown_res.channel_id;
2692
2696
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
2694
2698
);
2695
2699
log_error!(logger, "Force-closing channel: {}", err.err);
2696
2700
0 commit comments