Skip to content

Commit 02372c9

Browse files
committed
Add PublicKey to ShutdownResult
1 parent 5e075fe commit 02372c9

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5498,7 +5498,7 @@ impl<Signer: Sign> Channel<Signer> {
54985498
/// those explicitly stated to be allowed after shutdown completes, eg some simple getters).
54995499
/// Also returns the list of payment_hashes for channels which we can safely fail backwards
55005500
/// immediately (others we will have to allow to time out).
5501-
pub fn force_shutdown(&mut self, should_broadcast: bool) -> (Option<(OutPoint, ChannelMonitorUpdate)>, Vec<(HTLCSource, PaymentHash)>) {
5501+
pub fn force_shutdown(&mut self, should_broadcast: bool) -> (Option<(OutPoint, ChannelMonitorUpdate)>, Vec<(HTLCSource, PaymentHash, PublicKey)>) {
55025502
// Note that we MUST only generate a monitor update that indicates force-closure - we're
55035503
// called during initialization prior to the chain_monitor in the encompassing ChannelManager
55045504
// being fully configured in some cases. Thus, its likely any monitor events we generate will
@@ -5508,10 +5508,11 @@ impl<Signer: Sign> Channel<Signer> {
55085508
// We go ahead and "free" any holding cell HTLCs or HTLCs we haven't yet committed to and
55095509
// return them to fail the payment.
55105510
let mut dropped_outbound_htlcs = Vec::with_capacity(self.holding_cell_htlc_updates.len());
5511+
let counterparty_node_id = self.get_counterparty_node_id();
55115512
for htlc_update in self.holding_cell_htlc_updates.drain(..) {
55125513
match htlc_update {
55135514
HTLCUpdateAwaitingACK::AddHTLC { source, payment_hash, .. } => {
5514-
dropped_outbound_htlcs.push((source, payment_hash));
5515+
dropped_outbound_htlcs.push((source, payment_hash, counterparty_node_id));
55155516
},
55165517
_ => {}
55175518
}

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ enum ClaimFundsFromHop {
538538
DuplicateClaim,
539539
}
540540

541-
type ShutdownResult = (Option<(OutPoint, ChannelMonitorUpdate)>, Vec<(HTLCSource, PaymentHash)>);
541+
type ShutdownResult = (Option<(OutPoint, ChannelMonitorUpdate)>, Vec<(HTLCSource, PaymentHash, PublicKey)>);
542542

543543
/// Error type returned across the channel_state mutex boundary. When an Err is generated for a
544544
/// Channel, we generally end up with a ChannelError::Close for which we have to close the channel

0 commit comments

Comments
 (0)