@@ -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
@@ -2004,14 +2008,14 @@ macro_rules! handle_error {
2004
2008
2005
2009
match $internal {
2006
2010
Ok(msg) => Ok(msg),
2007
- Err(MsgHandleErrInternal { err, shutdown_finish, .. }) => {
2011
+ Err(MsgHandleErrInternal { err, shutdown_finish, payment_hash, .. }) => {
2008
2012
let mut msg_events = Vec::with_capacity(2);
2009
2013
2010
2014
if let Some((shutdown_res, update_option)) = shutdown_finish {
2011
2015
let counterparty_node_id = shutdown_res.counterparty_node_id;
2012
2016
let channel_id = shutdown_res.channel_id;
2013
2017
let logger = WithContext::from(
2014
- &$self.logger, Some(counterparty_node_id), Some(channel_id), None
2018
+ &$self.logger, Some(counterparty_node_id), Some(channel_id), payment_hash
2015
2019
);
2016
2020
log_error!(logger, "Force-closing channel: {}", err.err);
2017
2021
0 commit comments