mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Remove unused errChan fields from the loopin, openchannel, and withdraw managers. These channels were declared and initialized but never read from or written to. Remove the unused activeLoopIns map from the loopin manager. The map was only written to but never read, making it dead code. Remove the stale withdraw.Store interface whose method signatures no longer match the concrete SqlStore API used by the manager. Remove unused config fields from openchannel.Config (Server, AddressManager, ChainNotifier, Signer) and deposit.ManagerConfig (AddressClient, SwapClient, ChainParams) along with their daemon wiring. Also remove the now-orphaned openchannel.AddressManager interface. Remove the unused GetStaticAddress and Close methods from address.SqlStore and the GetStaticAddress method from the address.Store interface, as the codebase only uses GetAllStaticAddresses.
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package withdraw
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/btcsuite/btcd/wire"
|
|
"github.com/lightninglabs/loop/fsm"
|
|
"github.com/lightninglabs/loop/staticaddr/address"
|
|
"github.com/lightninglabs/loop/staticaddr/deposit"
|
|
"github.com/lightninglabs/loop/staticaddr/script"
|
|
)
|
|
|
|
// AddressManager handles fetching of address parameters.
|
|
type AddressManager interface {
|
|
// GetStaticAddressParameters returns the static address parameters.
|
|
GetStaticAddressParameters(ctx context.Context) (*address.Parameters,
|
|
error)
|
|
|
|
// GetStaticAddress returns the deposit address for the given
|
|
// client and server public keys.
|
|
GetStaticAddress(ctx context.Context) (*script.StaticAddress, error)
|
|
}
|
|
|
|
type DepositManager interface {
|
|
GetActiveDepositsInState(stateFilter fsm.StateType) ([]*deposit.Deposit,
|
|
error)
|
|
|
|
AllOutpointsActiveDeposits(outpoints []wire.OutPoint,
|
|
stateFilter fsm.StateType) ([]*deposit.Deposit, bool)
|
|
|
|
TransitionDeposits(ctx context.Context, deposits []*deposit.Deposit,
|
|
event fsm.EventType, expectedFinalState fsm.StateType) error
|
|
|
|
UpdateDeposit(ctx context.Context, d *deposit.Deposit) error
|
|
}
|