Skip to content

Commit ecc3ec5

Browse files
committed
f only remove compl updates on first loop
1 parent b2b8714 commit ecc3ec5

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
@@ -6092,19 +6092,20 @@ where
60926092
self.pending_outbound_payments.clear_pending_payments()
60936093
}
60946094

6095-
fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
6095+
fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, mut completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
60966096
let mut errors = Vec::new();
60976097
loop {
60986098
let per_peer_state = self.per_peer_state.read().unwrap();
60996099
if let Some(peer_state_mtx) = per_peer_state.get(&counterparty_node_id) {
61006100
let mut peer_state_lck = peer_state_mtx.lock().unwrap();
61016101
let peer_state = &mut *peer_state_lck;
61026102

6103-
if let Some(blocker) = &completed_blocker {
6103+
if let Some(blocker) = completed_blocker.take() {
6104+
// Only do this on the first iteration of the loop.
61046105
if let Some(blockers) = peer_state.actions_blocking_raa_monitor_updates
61056106
.get_mut(&channel_funding_outpoint.to_channel_id())
61066107
{
6107-
blockers.retain(|iter| iter != blocker);
6108+
blockers.retain(|iter| iter != &blocker);
61086109
}
61096110
}
61106111

0 commit comments

Comments
 (0)