File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ const (
2828
2929var defaultConfig = config {
3030 Network : "mainnet" ,
31- SwapServer : mainnetServer ,
3231 RPCListen : "localhost:11010" ,
3332 RESTListen : "localhost:8081" ,
3433 Insecure : false ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
22
33import (
44 "context"
5+ "errors"
56 "fmt"
67 "net"
78 "net/http"
@@ -26,13 +27,21 @@ func daemon(config *config) error {
2627 }
2728 defer lnd .Close ()
2829
29- // If the user is targeting the testnet network, and they haven't
30- // specified new swap server, then we'll point towards the testnet swap
31- // server rather than the mainnet endpoint.
32- if config .Network == "testnet" && config .SwapServer == "" {
33- config .SwapServer = testnetServer
30+ // If no swap server is specified, use the default addresses for mainnet
31+ // and testnet.
32+ if config .SwapServer == "" {
33+ switch config .Network {
34+ case "mainnet" :
35+ config .SwapServer = mainnetServer
36+ case "testnet" :
37+ config .SwapServer = testnetServer
38+ default :
39+ return errors .New ("no swap server address specified" )
40+ }
3441 }
3542
43+ logger .Infof ("Swap server address: %v" , config .SwapServer )
44+
3645 // Create an instance of the loop client library.
3746 swapClient , cleanup , err := getClient (
3847 config .Network , config .SwapServer , config .Insecure ,
You can’t perform that action at this time.
0 commit comments