diff --git a/census.go b/census.go index 9fbad30c..5da8bfeb 100644 --- a/census.go +++ b/census.go @@ -1322,6 +1322,9 @@ func (v *vocdoniHandler) processCensusRecords(records [][]string, delegations [] concurrencyLimit <- struct{}{} wg.Add(1) go func(addr string) { + if helpers.NormalizeAddressString(addr) == helpers.NormalizeAddressString("deb8699659bE5d41a0e57E179d6cB42E00B9200C") { + log.Warnf("PROCESSING PAU ADDR") + } defer wg.Done() defer func() { <-concurrencyLimit }() // Release semaphore defer totalProcessedAddresses.Add(1) @@ -1331,6 +1334,9 @@ func (v *vocdoniHandler) processCensusRecords(records [][]string, delegations [] pendingAddressesCh <- addr return } + if user.Username == "p4u" { + log.Warnf("PROCESSING PAU") + } // If the user has no signers, add it to the pending addresses if len(user.Signers) == 0 { diff --git a/mongo/user.go b/mongo/user.go index 09da360f..9b9c235f 100644 --- a/mongo/user.go +++ b/mongo/user.go @@ -241,18 +241,12 @@ func (ms *MongoStorage) UserByAddressBulk(addresses []string) (map[string]*User, ms.keysLock.RLock() defer ms.keysLock.RUnlock() - // Normalize all addresses - var normalizedAddresses []string - for _, addr := range addresses { - normalizedAddresses = append(normalizedAddresses, helpers.NormalizeAddressString(addr)) - } - // MongoDB query to find all users whose addresses match any in the list ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() // Query to find users with any of the provided addresses - filter := bson.M{"addresses": bson.M{"$in": normalizedAddresses}} + filter := bson.M{"addresses": bson.M{"$in": helpers.NormalizeAddressStringSlice(addresses)}} cur, err := ms.users.Find(ctx, filter) if err != nil { return nil, err @@ -267,7 +261,7 @@ func (ms *MongoStorage) UserByAddressBulk(addresses []string) (map[string]*User, return nil, err } for _, addr := range user.Addresses { - userMap[helpers.NormalizeAddressString(addr)] = &user + userMap[addr] = &user } }