@@ -21,7 +21,7 @@ type BaseDB interface {
2121
2222 // GetBatchSweeps fetches all the sweeps that are part a batch.
2323 GetBatchSweeps (ctx context.Context , batchID int32 ) (
24- []sqlc.GetBatchSweepsRow , error )
24+ []sqlc.Sweep , error )
2525
2626 // GetBatchSweptAmount returns the total amount of sats swept by a
2727 // (confirmed) batch.
@@ -34,10 +34,6 @@ type BaseDB interface {
3434 GetParentBatch (ctx context.Context , swapHash []byte ) (sqlc.SweepBatch ,
3535 error )
3636
37- // GetSwapUpdates fetches all the updates for a swap.
38- GetSwapUpdates (ctx context.Context , swapHash []byte ) (
39- []sqlc.SwapUpdate , error )
40-
4137 // GetUnconfirmedBatches fetches all the batches from the
4238 // database that are not in a confirmed state.
4339 GetUnconfirmedBatches (ctx context.Context ) ([]sqlc.SweepBatch , error )
@@ -154,14 +150,7 @@ func (s *SQLStore) FetchBatchSweeps(ctx context.Context, id int32) (
154150 }
155151
156152 for _ , dbSweep := range dbSweeps {
157- updates , err := s .baseDb .GetSwapUpdates (
158- ctx , dbSweep .SwapHash ,
159- )
160- if err != nil {
161- return err
162- }
163-
164- sweep , err := s .convertSweepRow (dbSweep , updates )
153+ sweep , err := s .convertSweepRow (dbSweep )
165154 if err != nil {
166155 return err
167156 }
@@ -260,9 +249,6 @@ type dbSweep struct {
260249
261250 // Completed indicates whether this sweep is completed.
262251 Completed bool
263-
264- // LoopOut is the loop out that the sweep belongs to.
265- LoopOut * loopdb.LoopOut
266252}
267253
268254// convertBatchRow converts a batch row from db to a sweepbatcher.Batch struct.
@@ -354,9 +340,7 @@ func batchToUpdateArgs(batch dbBatch) sqlc.UpdateBatchParams {
354340}
355341
356342// convertSweepRow converts a sweep row from db to a sweep struct.
357- func (s * SQLStore ) convertSweepRow (row sqlc.GetBatchSweepsRow ,
358- updates []sqlc.SwapUpdate ) (dbSweep , error ) {
359-
343+ func (s * SQLStore ) convertSweepRow (row sqlc.Sweep ) (dbSweep , error ) {
360344 sweep := dbSweep {
361345 ID : row .ID ,
362346 BatchID : row .BatchID ,
@@ -380,40 +364,7 @@ func (s *SQLStore) convertSweepRow(row sqlc.GetBatchSweepsRow,
380364 Index : uint32 (row .OutpointIndex ),
381365 }
382366
383- sweep .LoopOut , err = loopdb .ConvertLoopOutRow (
384- s .network ,
385- sqlc.GetLoopOutSwapRow {
386- ID : row .ID ,
387- SwapHash : row .SwapHash ,
388- Preimage : row .Preimage ,
389- InitiationTime : row .InitiationTime ,
390- AmountRequested : row .AmountRequested ,
391- CltvExpiry : row .CltvExpiry ,
392- MaxMinerFee : row .MaxMinerFee ,
393- MaxSwapFee : row .MaxSwapFee ,
394- InitiationHeight : row .InitiationHeight ,
395- ProtocolVersion : row .ProtocolVersion ,
396- Label : row .Label ,
397- DestAddress : row .DestAddress ,
398- SwapInvoice : row .SwapInvoice ,
399- MaxSwapRoutingFee : row .MaxSwapRoutingFee ,
400- SweepConfTarget : row .SweepConfTarget ,
401- HtlcConfirmations : row .HtlcConfirmations ,
402- OutgoingChanSet : row .OutgoingChanSet ,
403- PrepayInvoice : row .PrepayInvoice ,
404- MaxPrepayRoutingFee : row .MaxPrepayRoutingFee ,
405- PublicationDeadline : row .PublicationDeadline ,
406- SingleSweep : row .SingleSweep ,
407- SenderScriptPubkey : row .SenderScriptPubkey ,
408- ReceiverScriptPubkey : row .ReceiverScriptPubkey ,
409- SenderInternalPubkey : row .SenderInternalPubkey ,
410- ReceiverInternalPubkey : row .ReceiverInternalPubkey ,
411- ClientKeyFamily : row .ClientKeyFamily ,
412- ClientKeyIndex : row .ClientKeyIndex ,
413- }, updates ,
414- )
415-
416- return sweep , err
367+ return sweep , nil
417368}
418369
419370// sweepToUpsertArgs converts a Sweep struct to the arguments needed to insert.
0 commit comments