@@ -535,13 +535,15 @@ func (b *Batcher) Run(ctx context.Context) error {
535535 case sweepReq := <- b .sweepReqs :
536536 sweep , err := b .fetchSweep (runCtx , sweepReq )
537537 if err != nil {
538- log .Warnf ("fetchSweep failed: %v." , err )
538+ warnf ("fetchSweep failed: %v." , err )
539+
539540 return err
540541 }
541542
542543 err = b .handleSweep (runCtx , sweep , sweepReq .Notifier )
543544 if err != nil {
544- log .Warnf ("handleSweep failed: %v." , err )
545+ warnf ("handleSweep failed: %v." , err )
546+
545547 return err
546548 }
547549
@@ -550,11 +552,13 @@ func (b *Batcher) Run(ctx context.Context) error {
550552 close (testReq .quit )
551553
552554 case err := <- b .errChan :
553- log .Warnf ("Batcher received an error: %v." , err )
555+ warnf ("Batcher received an error: %v." , err )
556+
554557 return err
555558
556559 case <- runCtx .Done ():
557- log .Infof ("Stopping Batcher: run context cancelled." )
560+ infof ("Stopping Batcher: run context cancelled." )
561+
558562 return runCtx .Err ()
559563 }
560564 }
@@ -612,8 +616,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
612616 return err
613617 }
614618
615- log . Infof ("Batcher handling sweep %x, completed=%v" , sweep . swapHash [: 6 ] ,
616- completed )
619+ infof ("Batcher handling sweep %x, completed=%v" ,
620+ sweep . swapHash [: 6 ], completed )
617621
618622 // If the sweep has already been completed in a confirmed batch then we
619623 // can't attach its notifier to the batch as that is no longer running.
@@ -624,8 +628,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
624628 // on-chain confirmations to prevent issues caused by reorgs.
625629 parentBatch , err := b .store .GetParentBatch (ctx , sweep .swapHash )
626630 if err != nil {
627- log . Errorf ("unable to get parent batch for sweep %x: " +
628- "%v" , sweep .swapHash [:6 ], err )
631+ errorf ("unable to get parent batch for sweep %x:" +
632+ " %v" , sweep .swapHash [:6 ], err )
629633
630634 return err
631635 }
@@ -676,8 +680,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
676680 return nil
677681 }
678682
679- log . Warnf ("Greedy batch selection algorithm failed for sweep %x: %v. " +
680- "Falling back to old approach." , sweep .swapHash [:6 ], err )
683+ warnf ("Greedy batch selection algorithm failed for sweep %x: %v." +
684+ " Falling back to old approach." , sweep .swapHash [:6 ], err )
681685
682686 // If one of the batches accepts the sweep, we provide it to that batch.
683687 for _ , batch := range b .batches {
@@ -782,13 +786,13 @@ func (b *Batcher) spinUpBatchFromDB(ctx context.Context, batch *batch) error {
782786 }
783787
784788 if len (dbSweeps ) == 0 {
785- log . Infof ("skipping restored batch %d as it has no sweeps" ,
789+ infof ("skipping restored batch %d as it has no sweeps" ,
786790 batch .id )
787791
788792 // It is safe to drop this empty batch as it has no sweeps.
789793 err := b .store .DropBatch (ctx , batch .id )
790794 if err != nil {
791- log . Warnf ("unable to drop empty batch %d: %v" ,
795+ warnf ("unable to drop empty batch %d: %v" ,
792796 batch .id , err )
793797 }
794798
@@ -930,7 +934,7 @@ func (b *Batcher) monitorSpendAndNotify(ctx context.Context, sweep *sweep,
930934 b .wg .Add (1 )
931935 go func () {
932936 defer b .wg .Done ()
933- log . Infof ("Batcher monitoring spend for swap %x" ,
937+ infof ("Batcher monitoring spend for swap %x" ,
934938 sweep .swapHash [:6 ])
935939
936940 for {
@@ -1109,7 +1113,7 @@ func (b *Batcher) loadSweep(ctx context.Context, swapHash lntypes.Hash,
11091113 }
11101114 } else {
11111115 if s .ConfTarget == 0 {
1112- log . Warnf ("Fee estimation was requested for zero " +
1116+ warnf ("Fee estimation was requested for zero " +
11131117 "confTarget for sweep %x." , swapHash [:6 ])
11141118 }
11151119 minFeeRate , err = b .wallet .EstimateFeeRate (ctx , s .ConfTarget )
0 commit comments