File tree Expand file tree Collapse file tree 1 file changed +19
-13
lines changed
Expand file tree Collapse file tree 1 file changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -259,20 +259,26 @@ where
259259 . filter ( |desc| !matches ! ( desc, SpendableOutputDescriptor :: StaticOutput { .. } ) )
260260 . collect :: < Vec < _ > > ( ) ;
261261
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+ }
271265
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+ }
276282 }
277283
278284 self . rebroadcast_if_necessary ( ) ;
You can’t perform that action at this time.
0 commit comments