Browse Source
fix: display same error as lnd when multiple networks are selected
make_cert_optional
Otto Suess
6 years ago
No known key found for this signature in database
GPG Key ID: F7EFC44C2C240A11
2 changed files with
13 additions and
1 deletions
-
config.go
-
lndconnect.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" |
|
|
|
} |
|
|
|
|
|
@ -48,7 +48,7 @@ func getPublicIP() string { |
|
|
|
func main() { |
|
|
|
loadedConfig, err := loadConfig() |
|
|
|
if err != nil { |
|
|
|
fmt.Println() |
|
|
|
fmt.Println(err) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|