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.
50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
package address
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/btcsuite/btcd/btcec/v2"
|
|
"github.com/lightninglabs/loop/staticaddr/version"
|
|
"github.com/lightningnetwork/lnd/keychain"
|
|
)
|
|
|
|
// Store is the database interface that is used to store and retrieve
|
|
// static addresses.
|
|
type Store interface {
|
|
// CreateStaticAddress inserts a new static address with its parameters
|
|
// into the store.
|
|
CreateStaticAddress(ctx context.Context, addrParams *Parameters) error
|
|
|
|
// GetAllStaticAddresses retrieves all static addresses from the store.
|
|
GetAllStaticAddresses(ctx context.Context) ([]*Parameters,
|
|
error)
|
|
}
|
|
|
|
// Parameters holds all the necessary information for the 2-of-2 multisig
|
|
// address.
|
|
type Parameters struct {
|
|
// ClientPubkey is the client's pubkey for the static address. It is
|
|
// used for the 2-of-2 funding output as well as for the client's
|
|
// timeout path.
|
|
ClientPubkey *btcec.PublicKey
|
|
|
|
// ServerPubkey is the server's pubkey for the static address. It is
|
|
// used for the 2-of-2 funding output.
|
|
ServerPubkey *btcec.PublicKey
|
|
|
|
// Expiry is the CSV timout value at which the client can claim the
|
|
// static address's timout path.
|
|
Expiry uint32
|
|
|
|
// PkScript is the unique static address's output script.
|
|
PkScript []byte
|
|
|
|
// KeyLocator is the locator of the client's key.
|
|
KeyLocator keychain.KeyLocator
|
|
|
|
// ProtocolVersion is the protocol version of the static address.
|
|
ProtocolVersion version.AddressProtocolVersion
|
|
|
|
// InitiationHeight is the height at which the address was initiated.
|
|
InitiationHeight int32
|
|
}
|