Skip to content

Commit

Permalink
f only remove compl updates on first loop
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBlueMatt committed May 10, 2023
1 parent b2b8714 commit ecc3ec5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6092,19 +6092,20 @@ where
self.pending_outbound_payments.clear_pending_payments()
}

fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
fn handle_monitor_update_release(&self, counterparty_node_id: PublicKey, channel_funding_outpoint: OutPoint, mut completed_blocker: Option<RAAMonitorUpdateBlockingAction>) {
let mut errors = Vec::new();
loop {
let per_peer_state = self.per_peer_state.read().unwrap();
if let Some(peer_state_mtx) = per_peer_state.get(&counterparty_node_id) {
let mut peer_state_lck = peer_state_mtx.lock().unwrap();
let peer_state = &mut *peer_state_lck;

if let Some(blocker) = &completed_blocker {
if let Some(blocker) = completed_blocker.take() {
// Only do this on the first iteration of the loop.
if let Some(blockers) = peer_state.actions_blocking_raa_monitor_updates
.get_mut(&channel_funding_outpoint.to_channel_id())
{
blockers.retain(|iter| iter != blocker);
blockers.retain(|iter| iter != &blocker);
}
}

Expand Down

0 comments on commit ecc3ec5

Please sign in to comment.