Skip to content

Commit fa9d1d1

Browse files
committed
Fallback close_channel_internal to force close pending channels
1 parent 72f1db0 commit fa9d1d1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,14 @@ where
23992399

24002400
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
24012401
let peer_state = &mut *peer_state_lock;
2402+
2403+
if peer_state.has_pending_channel(&channel_id) {
2404+
// If the channel was still in a pending channel map, then we force-close the channel, ignoring
2405+
// any channel-not-found errors.
2406+
let _ = self.force_close_channel_with_peer(&channel_id, counterparty_node_id, None, false);
2407+
return Ok(());
2408+
}
2409+
24022410
match peer_state.channel_by_id.entry(channel_id.clone()) {
24032411
hash_map::Entry::Occupied(mut chan_entry) => {
24042412
let funding_txo_opt = chan_entry.get().context.get_funding_txo();

0 commit comments

Comments
 (0)