Skip to content

Commit 68494f7

Browse files
committed
f only remove compl updates on first loop
1 parent 1de16c3 commit 68494f7

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
@@ -6112,19 +6112,20 @@ where
61126112
self.pending_outbound_payments.clear_pending_payments()
61136113
}
61146114

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

6123-
if let Some(blocker) = &completed_blocker {
6123+
if let Some(blocker) = completed_blocker.take() {
6124+
// Only do this on the first iteration of the loop.
61246125
if let Some(blockers) = peer_state.actions_blocking_raa_monitor_updates
61256126
.get_mut(&channel_funding_outpoint.to_channel_id())
61266127
{
6127-
blockers.retain(|iter| iter != blocker);
6128+
blockers.retain(|iter| iter != &blocker);
61286129
}
61296130
}
61306131

0 commit comments

Comments
 (0)