@@ -328,8 +328,8 @@ func (b *Batcher) handleSweep(ctx context.Context, sweep *sweep,
328328
329329 if ! accepted {
330330 return fmt .Errorf ("existing sweep %x was not " +
331- "accepted by batch %d" , sweep . swapHash [: 6 ],
332- batch .id )
331+ "accepted by batch %d" ,
332+ sweep . swapHash [: 6 ], batch .id )
333333 }
334334
335335 // The sweep was updated in the batch, our job is done.
@@ -464,6 +464,8 @@ func (b *Batcher) spinUpBatchFromDB(ctx context.Context, batch *batch) error {
464464 FeeRate : batch .rbfCache .FeeRate ,
465465 }
466466
467+ logger := batchPrefixLogger (fmt .Sprintf ("%d" , batch .id ))
468+
467469 batchKit := batchKit {
468470 id : batch .id ,
469471 batchTxid : batch .batchTxid ,
@@ -480,7 +482,7 @@ func (b *Batcher) spinUpBatchFromDB(ctx context.Context, batch *batch) error {
480482 verifySchnorrSig : b .VerifySchnorrSig ,
481483 purger : b .AddSweep ,
482484 store : b .store ,
483- log : batchPrefixLogger ( fmt . Sprintf ( "%d" , batch . id )) ,
485+ log : logger ,
484486 quit : b .quit ,
485487 }
486488
@@ -601,15 +603,17 @@ func (b *Batcher) monitorSpendAndNotify(ctx context.Context, sweep *sweep,
601603 totalSwept ,
602604 )
603605
606+ onChainFeePortion := getFeePortionPaidBySweep (
607+ spendTx , feePortionPerSweep ,
608+ roundingDifference , sweep ,
609+ )
610+
604611 // Notify the requester of the spend
605612 // with the spend details, including the fee
606613 // portion for this particular sweep.
607614 spendDetail := & SpendDetail {
608- Tx : spendTx ,
609- OnChainFeePortion : getFeePortionPaidBySweep ( // nolint:lll
610- spendTx , feePortionPerSweep ,
611- roundingDifference , sweep ,
612- ),
615+ Tx : spendTx ,
616+ OnChainFeePortion : onChainFeePortion ,
613617 }
614618
615619 select {
0 commit comments