Skip to content

Commit e23741b

Browse files
committed
Fallback close_channel_internal to force close pending channels
1 parent a6f2c12 commit e23741b

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
@@ -2394,6 +2394,14 @@ where
23942394

23952395
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
23962396
let peer_state = &mut *peer_state_lock;
2397+
2398+
if peer_state.has_pending_channel(&channel_id) {
2399+
// If the channel was still in a pending channel map, then we force-close the channel, ignoring
2400+
// any channel-not-found errors.
2401+
let _ = self.force_close_channel_with_peer(&channel_id, counterparty_node_id, None, false);
2402+
return Ok(());
2403+
}
2404+
23972405
match peer_state.channel_by_id.entry(channel_id.clone()) {
23982406
hash_map::Entry::Occupied(mut chan_entry) => {
23992407
let funding_txo_opt = chan_entry.get().context.get_funding_txo();

0 commit comments

Comments
 (0)