engine: filter and warning for empty string when syncing all deposit addresses (#1086)

* helpers: transfer chains and deposit addresses filter and alert zero value string

* engine: remove 'Err:' as it's not an error.

* engine: remove '.' to be in line with other logs.

Co-authored-by: Ryan O'Hara-Reid <ryan.oharareid@thrasher.io>
This commit is contained in:
Ryan O'Hara-Reid
2022-11-16 16:14:54 +11:00
committed by GitHub
parent 33aa26a140
commit e7c6fe9439
2 changed files with 8 additions and 1 deletions

View File

@@ -742,6 +742,13 @@ func (bot *Engine) GetAllExchangeCryptocurrencyDepositAddresses() map[string]map
depositAddrs = append(depositAddrs, *depositAddr)
}
for z := range availChains {
if availChains[z] == "" {
log.Warnf(log.Global, "%s %s available transfer chain is populated with an empty string\n",
exchName,
cryptocurrency)
continue
}
depositAddr, err := exch.GetDepositAddress(context.TODO(), currency.NewCode(cryptocurrency), "", availChains[z])
if err != nil {
log.Errorf(log.Global, "%s failed to get cryptocurrency deposit address for %s [chain %s]. Err: %s\n",

View File

@@ -1029,7 +1029,7 @@ func (f fakeDepositExchange) GetAvailableTransferChains(_ context.Context, c cur
return nil, nil
}
if c.Equal(currency.USDT) {
return []string{"sol", "btc", "usdt"}, nil
return []string{"sol", "btc", "usdt", ""}, nil
}
return []string{"BITCOIN"}, nil
}