File tree 1 file changed +11
-20
lines changed
1 file changed +11
-20
lines changed Original file line number Diff line number Diff line change @@ -518,9 +518,7 @@ where
518
518
519
519
// Sweep the outputs.
520
520
{
521
- let mut runtime_sweeper_state = self . sweeper_state . lock ( ) . unwrap ( ) ;
522
-
523
- let sweeper_state = & mut runtime_sweeper_state;
521
+ let mut sweeper_state = self . sweeper_state . lock ( ) . unwrap ( ) ;
524
522
525
523
let change_destination_script = change_destination_script_result?;
526
524
@@ -539,24 +537,17 @@ where
539
537
return Ok ( ( ) ) ;
540
538
}
541
539
542
- let spending_tx = match self . spend_outputs (
543
- sweeper_state,
544
- & respend_descriptors,
545
- change_destination_script,
546
- ) {
547
- Ok ( spending_tx) => {
548
- log_debug ! (
549
- self . logger,
550
- "Generating and broadcasting sweeping transaction {}" ,
551
- spending_tx. compute_txid( )
552
- ) ;
553
- spending_tx
554
- } ,
555
- Err ( e) => {
540
+ let spending_tx = self
541
+ . spend_outputs ( & sweeper_state, & respend_descriptors, change_destination_script)
542
+ . map_err ( |e| {
556
543
log_error ! ( self . logger, "Error spending outputs: {:?}" , e) ;
557
- return Ok ( ( ) ) ;
558
- } ,
559
- } ;
544
+ } ) ?;
545
+
546
+ log_debug ! (
547
+ self . logger,
548
+ "Generating and broadcasting sweeping transaction {}" ,
549
+ spending_tx. compute_txid( )
550
+ ) ;
560
551
561
552
// As we didn't modify the state so far, the same filter_fn yields the same elements as
562
553
// above.
You can’t perform that action at this time.
0 commit comments