cmd/loopd: only replace testnet swapserver if not already set

This commit is contained in:
Olaoluwa Osuntokun 2019-04-24 18:26:45 -07:00
parent 893954e69b
commit f1f72bb2d1
No known key found for this signature in database
GPG key ID: CE58F7F8E20FD9A2

View file

@ -26,9 +26,10 @@ func daemon(config *config) error {
}
defer lnd.Close()
// If the user is targeting the testnet network, then we'll point
// towards the testnet swap server rather than the mainnet endpoint.
if config.Network == "testnet" {
// If the user is targeting the testnet network, and they haven't
// specified new swap server, then we'll point towards the testnet swap
// server rather than the mainnet endpoint.
if config.Network == "testnet" && config.SwapServer == "" {
config.SwapServer = testnetServer
}