Skip to content

Commit 9124314

Browse files
committed
f only remove compl updates on first loop
1 parent 66c0f70 commit 9124314

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6115,19 +6115,20 @@ where
61156115
self.pending_outbound_payments.clear_pending_payments()
61166116
}
61176117

6118-
fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
6118+
fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, mut completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
61196119
let mut errors = Vec::new();
61206120
loop {
61216121
let per_peer_state = self.per_peer_state.read().unwrap();
61226122
if let Some(peer_state_mtx) = per_peer_state.get(&counterparty_node_id) {
61236123
let mut peer_state_lck = peer_state_mtx.lock().unwrap();
61246124
let peer_state = &mut *peer_state_lck;
61256125

6126-
if let Some(blocker) = &completed_blocker {
6126+
if let Some(blocker) = completed_blocker.take() {
6127+
// Only do this on the first iteration of the loop.
61276128
if let Some(blockers) = peer_state.actions_blocking_raa_monitor_updates
61286129
.get_mut(&channel_funding_outpoint.to_channel_id())
61296130
{
6130-
blockers.retain(|iter| iter != blocker);
6131+
blockers.retain(|iter| iter != &blocker);
61316132
}
61326133
}
61336134

0 commit comments

Comments
 (0)