2
0
mirror of https://github.com/lightninglabs/loop synced 2024-11-08 01:10:29 +00:00
loop/loopd/utils.go

31 lines
806 B
Go
Raw Normal View History

package loopd
2019-03-06 20:13:50 +00:00
import (
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/loop"
2019-03-06 20:13:50 +00:00
)
// getClient returns an instance of the swap client.
2020-05-15 10:17:57 +00:00
func getClient(config *Config, lnd *lndclient.LndServices) (*loop.Client,
func(), error) {
2020-04-27 12:03:23 +00:00
clientConfig := &loop.ClientConfig{
ServerAddress: config.Server.Host,
ProxyAddress: config.Server.Proxy,
SwapServerNoTLS: config.Server.NoTLS,
TLSPathServer: config.Server.TLSPath,
2020-05-12 07:31:50 +00:00
Lnd: lnd,
MaxLsatCost: btcutil.Amount(config.MaxLSATCost),
MaxLsatFee: btcutil.Amount(config.MaxLSATFee),
LoopOutMaxParts: config.LoopOutMaxParts,
2020-04-27 12:03:23 +00:00
}
swapClient, cleanUp, err := loop.NewClient(config.DataDir, clientConfig)
2019-03-06 20:13:50 +00:00
if err != nil {
return nil, nil, err
}
return swapClient, cleanUp, nil
}