Skip to content

Commit 32e3a3c

Browse files
f - release the forward_htlc lock in process_pending_htlc_forwards
1 parent f66ad14 commit 32e3a3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3095,7 +3095,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
30953095
let mut channel_state_lock = self.channel_state.lock().unwrap();
30963096
let channel_state = &mut *channel_state_lock;
30973097

3098-
for (short_chan_id, mut pending_forwards) in self.forward_htlcs.lock().unwrap().drain() {
3098+
let mut forward_htlcs = HashMap::new();
3099+
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap().drain().collect());
3100+
3101+
for (short_chan_id, mut pending_forwards) in forward_htlcs {
30993102
if short_chan_id != 0 {
31003103
let forward_chan_id = match channel_state.short_to_chan_info.get(&short_chan_id) {
31013104
Some((_cp_id, chan_id)) => chan_id.clone(),

0 commit comments

Comments
 (0)