Skip to content

Commit 19f80e9

Browse files
committed
f use filter instead of a named loop with continue
1 parent 5fe9b2e commit 19f80e9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,14 @@ where C::Target: chain::Filter,
153153
pub fn get_claimable_balances(&self, ignored_channels: &[ChannelDetails]) -> Vec<ClaimableBalance> {
154154
let mut ret = Vec::new();
155155
let monitors = self.monitors.read().unwrap();
156-
'monitor_iter: for (funding_outpoint, monitor) in monitors.iter() {
156+
for (_, monitor) in monitors.iter().filter(|(funding_outpoint, _)| {
157157
for chan in ignored_channels {
158158
if chan.funding_txo.as_ref() == Some(funding_outpoint) {
159-
continue 'monitor_iter;
159+
return false;
160160
}
161161
}
162+
true
163+
}) {
162164
ret.append(&mut monitor.get_claimable_balances());
163165
}
164166
ret

0 commit comments

Comments
 (0)