Skip to content

Commit c8b9e69

Browse files
committed
f - remove temporary_channel_id parameter
1 parent 7d03d51 commit c8b9e69

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lightning/src/ln/channel.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,9 +1406,7 @@ impl<SP: Deref> Channel<SP> where
14061406
pub fn unset_funding_info(&mut self) {
14071407
let phase = core::mem::replace(&mut self.phase, ChannelPhase::Undefined);
14081408
if let ChannelPhase::Funded(mut funded_chan) = phase {
1409-
let temporary_channel_id = funded_chan.context.temporary_channel_id
1410-
.unwrap_or(funded_chan.context.channel_id);
1411-
funded_chan.unset_funding_info(temporary_channel_id);
1409+
funded_chan.unset_funding_info();
14121410

14131411
let context = funded_chan.context;
14141412
let unfunded_context = UnfundedChannelContext {
@@ -5001,12 +4999,13 @@ impl<SP: Deref> FundedChannel<SP> where
50014999
///
50025000
/// Further, the channel must be immediately shut down after this with a call to
50035001
/// [`ChannelContext::force_shutdown`].
5004-
pub fn unset_funding_info(&mut self, temporary_channel_id: ChannelId) {
5002+
pub fn unset_funding_info(&mut self) {
50055003
debug_assert!(matches!(
50065004
self.context.channel_state, ChannelState::AwaitingChannelReady(_)
50075005
));
50085006
self.context.channel_transaction_parameters.funding_outpoint = None;
5009-
self.context.channel_id = temporary_channel_id;
5007+
self.context.channel_id = self.context.temporary_channel_id
5008+
.unwrap_or(self.context.channel_id);
50105009
}
50115010

50125011
/// Handles a channel_ready message from our peer. If we've already sent our channel_ready

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8096,7 +8096,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
80968096
// `locked_close_channel`), we'll remove the existing channel from `outpoint_to_peer`.
80978097
// Thus, we must first unset the funding outpoint on the channel.
80988098
let err = ChannelError::close($err.to_owned());
8099-
chan.unset_funding_info(msg.temporary_channel_id);
8099+
chan.unset_funding_info();
81008100
return Err(convert_channel_err!(self, peer_state, err, chan.context, &funded_channel_id, UNFUNDED_CHANNEL).1);
81018101
} } }
81028102

0 commit comments

Comments
 (0)