File tree 1 file changed +12
-14
lines changed
1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -318,22 +318,18 @@ where
318
318
& self , mut output_descriptors : Vec < SpendableOutputDescriptor > ,
319
319
channel_id : Option < ChannelId > , exclude_static_ouputs : bool ,
320
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
- output_descriptors
328
- } ;
329
-
330
- if relevant_descriptors. is_empty ( ) {
331
- return ;
332
- }
333
-
321
+ let relevant_descriptors = output_descriptors
322
+ . drain ( ..)
323
+ . filter ( |desc| {
324
+ !( exclude_static_ouputs &&
325
+ matches ! ( desc, SpendableOutputDescriptor :: StaticOutput { .. } ) )
326
+ } ) ;
327
+
328
+ let mut processed_outputs = false ;
334
329
{
335
330
let mut locked_outputs = self . outputs . lock ( ) . unwrap ( ) ;
336
331
for descriptor in relevant_descriptors {
332
+ processed_outputs = true ;
337
333
let id = self . entropy_source . get_secure_random_bytes ( ) ;
338
334
let output_info = TrackedSpendableOutput {
339
335
id,
@@ -353,7 +349,9 @@ where
353
349
}
354
350
}
355
351
356
- self . rebroadcast_if_necessary ( ) ;
352
+ if processed_outputs {
353
+ self . rebroadcast_if_necessary ( ) ;
354
+ }
357
355
}
358
356
359
357
/// Returns a list of the currently tracked spendable outputs.
You can’t perform that action at this time.
0 commit comments