File tree 1 file changed +19
-13
lines changed 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -259,20 +259,26 @@ where
259
259
. filter ( |desc| !matches ! ( desc, SpendableOutputDescriptor :: StaticOutput { .. } ) )
260
260
. collect :: < Vec < _ > > ( ) ;
261
261
262
- let mut locked_outputs = self . outputs . lock ( ) . unwrap ( ) ;
263
- for descriptor in non_static_outputs {
264
- let id = self . keys_manager . get_secure_random_bytes ( ) ;
265
- let output_info = SpendableOutputInfo {
266
- id,
267
- descriptor,
268
- channel_id,
269
- status : SpendableOutputStatus :: Pending ,
270
- } ;
262
+ if non_static_outputs. is_empty ( ) {
263
+ return ;
264
+ }
271
265
272
- locked_outputs. push ( output_info. clone ( ) ) ;
273
- self . persist_status ( & output_info) . unwrap_or_else ( |e| {
274
- log_error ! ( self . logger, "Error persisting spendable output status: {:?}" , e)
275
- } ) ;
266
+ {
267
+ let mut locked_outputs = self . outputs . lock ( ) . unwrap ( ) ;
268
+ for descriptor in non_static_outputs {
269
+ let id = self . keys_manager . get_secure_random_bytes ( ) ;
270
+ let output_info = SpendableOutputInfo {
271
+ id,
272
+ descriptor,
273
+ channel_id,
274
+ status : SpendableOutputStatus :: Pending ,
275
+ } ;
276
+
277
+ locked_outputs. push ( output_info. clone ( ) ) ;
278
+ self . persist_status ( & output_info) . unwrap_or_else ( |e| {
279
+ log_error ! ( self . logger, "Error persisting spendable output status: {:?}" , e)
280
+ } ) ;
281
+ }
276
282
}
277
283
278
284
self . rebroadcast_if_necessary ( ) ;
You can’t perform that action at this time.
0 commit comments