Add blockchains filter.

pull/1167/head
Andrey 2025-01-31 20:01:28 +02:00
rodzic 022ad8c4c9
commit 699acd3bd8
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -107,8 +107,16 @@ func getBalances(ctx context.Context, address string) (BalancesResponse, error)
// Count active goroutines
var wg sync.WaitGroup
// get supported blockchains which are present in contractsConfig
supportedBlockchainsFiltered := make(map[string]bool)
for blockchain := range contractsConfig {
if _, ok := supportedBlockchains[blockchain]; ok {
supportedBlockchainsFiltered[blockchain] = true
}
}
// Process each blockchain in parallel
for blockchain := range supportedBlockchains {
for blockchain := range supportedBlockchainsFiltered {
wg.Add(1)
go func(blockchain string) {
defer wg.Done()