Skip to content

Commit

Permalink
trie: wait background commit when journal disk layer
Browse files Browse the repository at this point in the history
  • Loading branch information
unkonwn-coder committed Oct 29, 2021
1 parent 322351a commit d0fe0d4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions trie/journal.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,10 @@ func loadDiffLayer(parent snapshot, r *rlp.Stream) (snapshot, error) {
// the progress into the database.
func (dl *diskLayer) Journal(buffer *bytes.Buffer) error {
// Ensure the layer didn't get stale
dl.lock.RLock()
defer dl.lock.RUnlock()

if dl.stale {
if dl.Stale() {
return ErrSnapshotStale
}
dl.waitCommit()
return nil
}

Expand Down

0 comments on commit d0fe0d4

Please sign in to comment.