Skip to content

Commit

Permalink
acquire a multilock
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz committed Mar 16, 2024
1 parent 0ddbdfe commit 8dbad79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions beacon-chain/blockchain/process_attestation_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func (s *Service) getRecentPreState(ctx context.Context, c *ethpb.Checkpoint) st
if err != nil {
return nil
}
epochKey := strconv.FormatUint(uint64(c.Epoch), 10 /* base 10 */)
lock := async.NewMultilock(string(c.Root) + epochKey)
lock.Lock()
defer lock.Unlock()
st, err = transition.ProcessSlotsUsingNextSlotCache(ctx, st, c.Root, slot)
if err != nil {
return nil
Expand Down

0 comments on commit 8dbad79

Please sign in to comment.