Sync: use copied bits for seen cache (#10747)

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
terencechain 2022-05-24 14:11:33 -07:00 committed by GitHub
parent c922eb9bfc
commit edb03328ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -252,7 +252,9 @@ func (s *Service) setSeenCommitteeIndicesSlot(slot types.Slot, committeeID types
s.seenUnAggregatedAttestationLock.Lock() s.seenUnAggregatedAttestationLock.Lock()
defer s.seenUnAggregatedAttestationLock.Unlock() defer s.seenUnAggregatedAttestationLock.Unlock()
b := append(bytesutil.Bytes32(uint64(slot)), bytesutil.Bytes32(uint64(committeeID))...) b := append(bytesutil.Bytes32(uint64(slot)), bytesutil.Bytes32(uint64(committeeID))...)
b = append(b, aggregateBits...) var bits []byte
copy(bits, aggregateBits)
b = append(b, bits...)
s.seenUnAggregatedAttestationCache.Add(string(b), true) s.seenUnAggregatedAttestationCache.Add(string(b), true)
} }