mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Config: Fix AuthenticatedAPISupport default values check (#306)
* Fixes issue where first if statement always gets hit * fmtimport * Slightly more granular checks for keys, secret keys and clientids * Moves log warn and removes extra checks
This commit is contained in:
@@ -799,16 +799,22 @@ func (c *Config) CheckExchangeConfigValues() error {
|
||||
return fmt.Errorf(ErrExchangeBaseCurrenciesEmpty, c.Exchanges[i].Name)
|
||||
}
|
||||
if c.Exchanges[i].AuthenticatedAPISupport { // non-fatal error
|
||||
if c.Exchanges[i].APIKey == "" || c.Exchanges[i].APISecret == "" ||
|
||||
c.Exchanges[i].APIKey == DefaultUnsetAPIKey ||
|
||||
c.Exchanges[i].APISecret == DefaultUnsetAPISecret {
|
||||
if c.Exchanges[i].APIKey == "" || c.Exchanges[i].APIKey == DefaultUnsetAPIKey {
|
||||
c.Exchanges[i].AuthenticatedAPISupport = false
|
||||
}
|
||||
|
||||
if (c.Exchanges[i].APISecret == "" || c.Exchanges[i].APISecret == DefaultUnsetAPISecret) &&
|
||||
c.Exchanges[i].Name != "COINUT" {
|
||||
c.Exchanges[i].AuthenticatedAPISupport = false
|
||||
}
|
||||
|
||||
if (c.Exchanges[i].ClientID == "ClientID" || c.Exchanges[i].ClientID == "") &&
|
||||
(c.Exchanges[i].Name == "ITBIT" || c.Exchanges[i].Name == "Bitstamp" || c.Exchanges[i].Name == "COINUT" || c.Exchanges[i].Name == "CoinbasePro") {
|
||||
c.Exchanges[i].AuthenticatedAPISupport = false
|
||||
}
|
||||
|
||||
if !c.Exchanges[i].AuthenticatedAPISupport {
|
||||
log.Warnf(WarningExchangeAuthAPIDefaultOrEmptyValues, c.Exchanges[i].Name)
|
||||
} else if c.Exchanges[i].Name == "ITBIT" || c.Exchanges[i].Name == "Bitstamp" || c.Exchanges[i].Name == "COINUT" || c.Exchanges[i].Name == "CoinbasePro" {
|
||||
if c.Exchanges[i].ClientID == "" || c.Exchanges[i].ClientID == "ClientID" {
|
||||
c.Exchanges[i].AuthenticatedAPISupport = false
|
||||
log.Warnf(WarningExchangeAuthAPIDefaultOrEmptyValues, c.Exchanges[i].Name)
|
||||
}
|
||||
}
|
||||
}
|
||||
if !c.Exchanges[i].SupportsAutoPairUpdates {
|
||||
|
||||
Reference in New Issue
Block a user