Browse Source

fix: display same error as lnd when multiple networks are selected

make_cert_optional
Otto Suess 6 years ago
parent
commit
77abf0830f
No known key found for this signature in database GPG Key ID: F7EFC44C2C240A11
  1. 12
      config.go
  2. 2
      lndconnect.go

12
config.go

@ -154,18 +154,30 @@ func loadConfig() (*config, error) {
primaryChain = "litecoin"
networkName = "mainnet"
case cfg.Bitcoin.Active:
numNets := 0
if cfg.Bitcoin.MainNet {
numNets++
networkName = "mainnet"
}
if cfg.Bitcoin.TestNet3 {
numNets++
networkName = "testnet"
}
if cfg.Bitcoin.RegTest {
numNets++
networkName = "regtest"
}
if cfg.Bitcoin.SimNet {
numNets++
networkName = "simnet"
}
if numNets > 1 {
str := "The mainnet, testnet, regtest, and " +
"simnet params can't be used together -- " +
"choose one of the four"
err := fmt.Errorf(str)
return nil, err
}
primaryChain = "bitcoin"
}

2
lndconnect.go

@ -48,7 +48,7 @@ func getPublicIP() string {
func main() {
loadedConfig, err := loadConfig()
if err != nil {
fmt.Println()
fmt.Println(err)
return
}

Loading…
Cancel
Save