Skip to content

Commit 7d03d51

Browse files
committed
f - use temporary_channel_id in unset_funding_info
1 parent 92c6f77 commit 7d03d51

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lightning/src/ln/channel.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1403,9 +1403,11 @@ impl<SP: Deref> Channel<SP> where
14031403
result.map(|monitor| (self.as_funded_mut().expect("Channel should be funded"), monitor))
14041404
}
14051405

1406-
pub fn unset_funding_info(&mut self, temporary_channel_id: ChannelId) {
1406+
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);
14091411
funded_chan.unset_funding_info(temporary_channel_id);
14101412

14111413
let context = funded_chan.context;

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8179,7 +8179,7 @@ This indicates a bug inside LDK. Please report this error at https://github.com/
81798179
// updates should be made on it. Previously, full_stack_target
81808180
// found an (unreachable) panic when the monitor update contained
81818181
// within `shutdown_finish` was applied.
8182-
chan.unset_funding_info(msg.channel_id);
8182+
chan.unset_funding_info();
81838183
try_channel_entry!(self, peer_state, Err(e), chan_entry)
81848184
},
81858185
}

lightning/src/ln/functional_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9072,7 +9072,7 @@ fn test_duplicate_conflicting_funding_from_second_peer() {
90729072
check_added_monitors!(nodes[0], 1);
90739073
get_err_msg(&nodes[0], &nodes[1].node.get_our_node_id());
90749074
let err_reason = ClosureReason::ProcessingError { err: "Channel funding outpoint was a duplicate".to_owned() };
9075-
check_closed_events(&nodes[0], &[ExpectedCloseEvent::from_id_reason(funding_signed_msg.channel_id, true, err_reason)]);
9075+
check_closed_events(&nodes[0], &[ExpectedCloseEvent::from_id_reason(temp_chan_id, true, err_reason)]);
90769076
}
90779077

90789078
#[test]

0 commit comments

Comments
 (0)