Skip to content

Commit 0bd24ac

Browse files
committed
Fallback close_channel_internal to force close pending channels
1 parent d66b257 commit 0bd24ac

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
@@ -2392,6 +2392,14 @@ where
23922392

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

0 commit comments

Comments
 (0)