Skip to content

Commit cd1b4d1

Browse files
committed
f only remove compl updates on first loop
1 parent 55fefe4 commit cd1b4d1

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
@@ -6089,19 +6089,20 @@ where
60896089
self.pending_outbound_payments.clear_pending_payments()
60906090
}
60916091

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

6100-
if let Some(blocker) = &completed_blocker {
6100+
if let Some(blocker) = completed_blocker.take() {
6101+
// Only do this on the first iteration of the loop.
61016102
if let Some(blockers) = peer_state.actions_blocking_raa_monitor_updates
61026103
.get_mut(&channel_funding_outpoint.to_channel_id())
61036104
{
6104-
blockers.retain(|iter| iter != blocker);
6105+
blockers.retain(|iter| iter != &blocker);
61056106
}
61066107
}
61076108

0 commit comments

Comments
 (0)