fix: restore canonical token lookup for market caches
Build Docker Image / build (amd64) (push) Successful in 1m25s
Build Docker Image / build (amd64) (push) Successful in 1m25s
This commit is contained in:
@@ -25,17 +25,16 @@ func (ms *MarketData) refreshFuturePairCache() error {
|
||||
continue
|
||||
}
|
||||
futurePairs[s.Symbol] = true
|
||||
token := parseTokenFromSymbolByQuotePriority(s.Symbol)
|
||||
token := tokenKeyFromSymbol(s.Symbol)
|
||||
if token == "" {
|
||||
continue
|
||||
}
|
||||
token = futureCacheTokenKey(token)
|
||||
futureTokenCandidates[token] = append(futureTokenCandidates[token], s.Symbol)
|
||||
}
|
||||
|
||||
futureToken2Symbol := make(map[string]string, len(futureTokenCandidates))
|
||||
for token, candidates := range futureTokenCandidates {
|
||||
futureToken2Symbol[token] = selectCanonicalSymbolByQuotePriority(token, candidates)
|
||||
futureToken2Symbol[token] = selectCanonicalFutureSymbol(token, candidates)
|
||||
}
|
||||
|
||||
ms.pairCacheMutex.Lock()
|
||||
@@ -47,10 +46,6 @@ func (ms *MarketData) refreshFuturePairCache() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func futureCacheTokenKey(token string) string {
|
||||
return strings.ToUpper(token)
|
||||
}
|
||||
|
||||
func (ms *MarketData) IsFuturesPair(symbol string) bool {
|
||||
ms.pairCacheMutex.RLock()
|
||||
defer ms.pairCacheMutex.RUnlock()
|
||||
|
||||
Reference in New Issue
Block a user