Skip to content

Commit

Permalink
use lock in shredgroup Reset
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Dec 6, 2024
1 parent 0d28540 commit e2e3e70
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gturbine/gtshred/shred_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ func (g *ShredGroup) CollectShred(shred *gturbine.Shred) (bool, error) {

// Reset clears the ShredGroup data while maintaining allocated memory
func (g *ShredGroup) Reset() {
g.mu.Lock()
defer g.mu.Unlock()

g.GroupID = uuid.New().String()
g.BlockHash = g.BlockHash[:0]
g.Height = 0
Expand Down

0 comments on commit e2e3e70

Please sign in to comment.