Skip to content

Commit def4da9

Browse files
committed
Add payment_hash to MsgHandleErrInternal
1 parent 3aa7c6b commit def4da9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 3 deletions
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

@@ -2004,14 +2008,14 @@ macro_rules! handle_error {
20042008

20052009
match $internal {
20062010
Ok(msg) => Ok(msg),
2007-
Err(MsgHandleErrInternal { err, shutdown_finish, .. }) => {
2011+
Err(MsgHandleErrInternal { err, shutdown_finish, payment_hash, .. }) => {
20082012
let mut msg_events = Vec::with_capacity(2);
20092013

20102014
if let Some((shutdown_res, update_option)) = shutdown_finish {
20112015
let counterparty_node_id = shutdown_res.counterparty_node_id;
20122016
let channel_id = shutdown_res.channel_id;
20132017
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
20152019
);
20162020
log_error!(logger, "Force-closing channel: {}", err.err);
20172021

0 commit comments

Comments
 (0)