no need to hash it again (#13261)

This commit is contained in:
Nishant Das 2023-12-05 18:59:01 +08:00 committed by GitHub
parent ce2344301c
commit 705e98e3c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,15 +121,11 @@ func (c *AttCaches) DeleteSeenUnaggregatedAttestations() (int, error) {
defer c.unAggregateAttLock.Unlock()
count := 0
for _, att := range c.unAggregatedAtt {
for r, att := range c.unAggregatedAtt {
if att == nil || helpers.IsAggregated(att) {
continue
}
if seen, err := c.hasSeenBit(att); err == nil && seen {
r, err := hashFn(att)
if err != nil {
return count, errors.Wrap(err, "could not tree hash attestation")
}
delete(c.unAggregatedAtt, r)
count++
}