cmd+loopd: new cmd/loopd main method replacing the one now in ./loopd

This allows loopd to be used as a library by importing it and calling
Start.
This commit is contained in:
Johan T. Halseth 2020-01-03 14:01:31 +01:00
parent 644b5b16f7
commit 704bfff8f6
No known key found for this signature in database
GPG key ID: 15BAADA29DA20D26
2 changed files with 15 additions and 8 deletions

14
cmd/loopd/main.go Normal file
View file

@ -0,0 +1,14 @@
package main
import (
"fmt"
"github.com/lightninglabs/loop/loopd"
)
func main() {
err := loopd.Start()
if err != nil {
fmt.Println(err)
}
}

View file

@ -26,14 +26,7 @@ var (
swapsLock sync.Mutex
)
func main() {
err := start()
if err != nil {
fmt.Println(err)
}
}
func start() error {
func Start() error {
config := defaultConfig
// Parse command line flags.