Skip to content

Commit 4436b65

Browse files
committed
Add payment_hash to MsgHandleErrInternal
1 parent 7def422 commit 4436b65

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lightning/src/ln/channelmanager.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@ struct MsgHandleErrInternal {
572572
err: msgs::LightningError,
573573
closes_channel: bool,
574574
shutdown_finish: Option<(ShutdownResult, Option<msgs::ChannelUpdate>)>,
575+
payment_hash: Option<PaymentHash>
575576
}
576577
impl MsgHandleErrInternal {
577578
#[inline]
@@ -588,11 +589,12 @@ impl MsgHandleErrInternal {
588589
},
589590
closes_channel: false,
590591
shutdown_finish: None,
592+
payment_hash: None
591593
}
592594
}
593595
#[inline]
594596
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 }
596598
}
597599
#[inline]
598600
fn from_finish_shutdown(err: String, channel_id: ChannelId, shutdown_res: ShutdownResult, channel_update: Option<msgs::ChannelUpdate>) -> Self {
@@ -609,6 +611,7 @@ impl MsgHandleErrInternal {
609611
err: LightningError { err, action },
610612
closes_channel: true,
611613
shutdown_finish: Some((shutdown_res, channel_update)),
614+
payment_hash: None
612615
}
613616
}
614617
#[inline]
@@ -641,6 +644,7 @@ impl MsgHandleErrInternal {
641644
},
642645
closes_channel: false,
643646
shutdown_finish: None,
647+
payment_hash: None
644648
}
645649
}
646650

@@ -2021,14 +2025,14 @@ macro_rules! handle_error {
20212025

20222026
match $internal {
20232027
Ok(msg) => Ok(msg),
2024-
Err(MsgHandleErrInternal { err, shutdown_finish, .. }) => {
2028+
Err(MsgHandleErrInternal { err, shutdown_finish, payment_hash, .. }) => {
20252029
let mut msg_event = None;
20262030

20272031
if let Some((shutdown_res, update_option)) = shutdown_finish {
20282032
let counterparty_node_id = shutdown_res.counterparty_node_id;
20292033
let channel_id = shutdown_res.channel_id;
20302034
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
20322036
);
20332037
log_error!(logger, "Force-closing channel: {}", err.err);
20342038

0 commit comments

Comments
 (0)