@@ -535,13 +535,15 @@ func (b *Batcher) Run(ctx context.Context) error {
535
535
case sweepReq := <- b .sweepReqs :
536
536
sweep , err := b .fetchSweep (runCtx , sweepReq )
537
537
if err != nil {
538
- log .Warnf ("fetchSweep failed: %v." , err )
538
+ warnf ("fetchSweep failed: %v." , err )
539
+
539
540
return err
540
541
}
541
542
542
543
err = b .handleSweep (runCtx , sweep , sweepReq .Notifier )
543
544
if err != nil {
544
- log .Warnf ("handleSweep failed: %v." , err )
545
+ warnf ("handleSweep failed: %v." , err )
546
+
545
547
return err
546
548
}
547
549
@@ -550,11 +552,13 @@ func (b *Batcher) Run(ctx context.Context) error {
550
552
close (testReq .quit )
551
553
552
554
case err := <- b .errChan :
553
- log .Warnf ("Batcher received an error: %v." , err )
555
+ warnf ("Batcher received an error: %v." , err )
556
+
554
557
return err
555
558
556
559
case <- runCtx .Done ():
557
- log .Infof ("Stopping Batcher: run context cancelled." )
560
+ infof ("Stopping Batcher: run context cancelled." )
561
+
558
562
return runCtx .Err ()
559
563
}
560
564
}
@@ -612,8 +616,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
612
616
return err
613
617
}
614
618
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 )
617
621
618
622
// If the sweep has already been completed in a confirmed batch then we
619
623
// 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,
624
628
// on-chain confirmations to prevent issues caused by reorgs.
625
629
parentBatch , err := b .store .GetParentBatch (ctx , sweep .swapHash )
626
630
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 )
629
633
630
634
return err
631
635
}
@@ -676,8 +680,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
676
680
return nil
677
681
}
678
682
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 )
681
685
682
686
// If one of the batches accepts the sweep, we provide it to that batch.
683
687
for _ , batch := range b .batches {
@@ -782,13 +786,13 @@ func (b *Batcher) spinUpBatchFromDB(ctx context.Context, batch *batch) error {
782
786
}
783
787
784
788
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" ,
786
790
batch .id )
787
791
788
792
// It is safe to drop this empty batch as it has no sweeps.
789
793
err := b .store .DropBatch (ctx , batch .id )
790
794
if err != nil {
791
- log . Warnf ("unable to drop empty batch %d: %v" ,
795
+ warnf ("unable to drop empty batch %d: %v" ,
792
796
batch .id , err )
793
797
}
794
798
@@ -930,7 +934,7 @@ func (b *Batcher) monitorSpendAndNotify(ctx context.Context, sweep *sweep,
930
934
b .wg .Add (1 )
931
935
go func () {
932
936
defer b .wg .Done ()
933
- log . Infof ("Batcher monitoring spend for swap %x" ,
937
+ infof ("Batcher monitoring spend for swap %x" ,
934
938
sweep .swapHash [:6 ])
935
939
936
940
for {
@@ -1109,7 +1113,7 @@ func (b *Batcher) loadSweep(ctx context.Context, swapHash lntypes.Hash,
1109
1113
}
1110
1114
} else {
1111
1115
if s .ConfTarget == 0 {
1112
- log . Warnf ("Fee estimation was requested for zero " +
1116
+ warnf ("Fee estimation was requested for zero " +
1113
1117
"confTarget for sweep %x." , swapHash [:6 ])
1114
1118
}
1115
1119
minFeeRate , err = b .wallet .EstimateFeeRate (ctx , s .ConfTarget )
0 commit comments