Skip to content

Commit 71334fa

Browse files
f - release the forward_htlc lock in process_pending_htlc_forwards
1 parent 425fcc6 commit 71334fa

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
@@ -3098,7 +3098,10 @@ impl<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> ChannelMana
30983098
let mut channel_state_lock = self.channel_state.lock().unwrap();
30993099
let channel_state = &mut *channel_state_lock;
31003100

3101-
for (short_chan_id, mut pending_forwards) in self.forward_htlcs.lock().unwrap().drain() {
3101+
let mut forward_htlcs = HashMap::new();
3102+
mem::swap(&mut forward_htlcs, &mut self.forward_htlcs.lock().unwrap().drain().collect());
3103+
3104+
for (short_chan_id, mut pending_forwards) in forward_htlcs {
31023105
if short_chan_id != 0 {
31033106
let forward_chan_id = match channel_state.short_to_chan_info.get(&short_chan_id) {
31043107
Some((_cp_id, chan_id)) => chan_id.clone(),

0 commit comments

Comments
 (0)