You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
loop/loopd/utils.go

31 lines
806 B
Go

package loopd
import (
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/loop"
)
// getClient returns an instance of the swap client.
func getClient(config *Config, lnd *lndclient.LndServices) (*loop.Client,
func(), error) {
clientConfig := &loop.ClientConfig{
ServerAddress: config.Server.Host,
ProxyAddress: config.Server.Proxy,
SwapServerNoTLS: config.Server.NoTLS,
TLSPathServer: config.Server.TLSPath,
Lnd: lnd,
MaxLsatCost: btcutil.Amount(config.MaxLSATCost),
MaxLsatFee: btcutil.Amount(config.MaxLSATFee),
LoopOutMaxParts: config.LoopOutMaxParts,
}
swapClient, cleanUp, err := loop.NewClient(config.DataDir, clientConfig)
if err != nil {
return nil, nil, err
}
return swapClient, cleanUp, nil
}