Skip to content

Commit 7ff65e2

Browse files
committed
Fallback close_channel_internal to force close pending channels
1 parent 8387cd6 commit 7ff65e2

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
@@ -2346,6 +2346,14 @@ where
23462346

23472347
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
23482348
let peer_state = &mut *peer_state_lock;
2349+
2350+
if peer_state.has_pending_channel(&channel_id) {
2351+
// If the channel was still in a pending channel map, then we force-close the channel, ignoring
2352+
// any channel-not-found errors.
2353+
let _ = self.force_close_channel_with_peer(&channel_id, counterparty_node_id, None, false);
2354+
return Ok(());
2355+
}
2356+
23492357
match peer_state.channel_by_id.entry(channel_id.clone()) {
23502358
hash_map::Entry::Occupied(mut chan_entry) => {
23512359
let funding_txo_opt = chan_entry.get().context.get_funding_txo();

0 commit comments

Comments
 (0)