Skip to content

Commit 3e255fe

Browse files
committed
f only remove compl updates on first loop
1 parent 733e1f4 commit 3e255fe

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
@@ -6099,19 +6099,20 @@ where
60996099
self.pending_outbound_payments.clear_pending_payments()
61006100
}
61016101

6102-
fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
6102+
fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, mut completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
61036103
let mut errors = Vec::new();
61046104
loop {
61056105
let per_peer_state = self.per_peer_state.read().unwrap();
61066106
if let Some(peer_state_mtx) = per_peer_state.get(&counterparty_node_id) {
61076107
let mut peer_state_lck = peer_state_mtx.lock().unwrap();
61086108
let peer_state = &mut *peer_state_lck;
61096109

6110-
if let Some(blocker) = &completed_blocker {
6110+
if let Some(blocker) = completed_blocker.take() {
6111+
// Only do this on the first iteration of the loop.
61116112
if let Some(blockers) = peer_state.actions_blocking_raa_monitor_updates
61126113
.get_mut(&channel_funding_outpoint.to_channel_id())
61136114
{
6114-
blockers.retain(|iter| iter != blocker);
6115+
blockers.retain(|iter| iter != &blocker);
61156116
}
61166117
}
61176118

0 commit comments

Comments
 (0)