Skip to content

Commit

Permalink
core/state/snapshot: fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden committed Apr 12, 2022
1 parent 1e973a9 commit ea16199
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/state/snapshot/difflayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ func (dl *diffLayer) Root() common.Hash {

// Parent returns the subsequent layer of a diff layer.
func (dl *diffLayer) Parent() snapshot {
dl.lock.RLock()
defer dl.lock.RUnlock()
return dl.parent
}

Expand Down

0 comments on commit ea16199

Please sign in to comment.