We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 735b89f commit 2de3f2cCopy full SHA for 2de3f2c
lightning/src/util/sweep.rs
@@ -318,16 +318,14 @@ where
318
&self, mut output_descriptors: Vec<SpendableOutputDescriptor>,
319
channel_id: Option<ChannelId>, exclude_static_ouputs: bool,
320
) {
321
- let relevant_descriptors = if exclude_static_ouputs {
322
- output_descriptors
323
- .drain(..)
324
- .filter(|desc| !matches!(desc, SpendableOutputDescriptor::StaticOutput { .. }))
325
- .collect::<Vec<_>>()
326
- } else {
327
328
- };
329
-
330
- if relevant_descriptors.is_empty() {
+ let mut relevant_descriptors = output_descriptors
+ .drain(..)
+ .filter(|desc| {
+ !(exclude_static_ouputs &&
+ matches!(desc, SpendableOutputDescriptor::StaticOutput { .. }))
+ }).peekable();
+
+ if relevant_descriptors.peek().is_none() {
331
return;
332
}
333
0 commit comments