@@ -82,6 +82,14 @@ type BatcherStore interface {
8282 TotalSweptAmount (ctx context.Context , id int32 ) (btcutil.Amount , error )
8383}
8484
85+ // LoopOutFetcher is used to load LoopOut swaps from the database.
86+ // It is implemented by loopdb.SwapStore.
87+ type LoopOutFetcher interface {
88+ // FetchLoopOutSwap returns the loop out swap with the given hash.
89+ FetchLoopOutSwap (ctx context.Context ,
90+ hash lntypes.Hash ) (* loopdb.LoopOut , error )
91+ }
92+
8593// MuSig2SignSweep is a function that can be used to sign a sweep transaction
8694// cooperatively with the swap server.
8795type MuSig2SignSweep func (ctx context.Context ,
@@ -183,9 +191,8 @@ type Batcher struct {
183191 // batcher and the batches.
184192 store BatcherStore
185193
186- // swapStore includes all the database interactions that are needed for
187- // interacting with swaps.
188- swapStore loopdb.SwapStore
194+ // swapStore is used to load LoopOut swaps from the database.
195+ swapStore LoopOutFetcher
189196
190197 // wg is a waitgroup that is used to wait for all the goroutines to
191198 // exit.
@@ -197,7 +204,7 @@ func NewBatcher(wallet lndclient.WalletKitClient,
197204 chainNotifier lndclient.ChainNotifierClient ,
198205 signerClient lndclient.SignerClient , musig2ServerSigner MuSig2SignSweep ,
199206 verifySchnorrSig VerifySchnorrSig , chainparams * chaincfg.Params ,
200- store BatcherStore , swapStore loopdb. SwapStore ) * Batcher {
207+ store BatcherStore , swapStore LoopOutFetcher ) * Batcher {
201208
202209 return & Batcher {
203210 batches : make (map [int32 ]* batch ),
0 commit comments