Skip to content

Commit

Permalink
Revert "Fix saveRoot() to delete root node from recentDB"
Browse files Browse the repository at this point in the history
This reverts commit 1735fa9.

Deleting root node from recentDB doesn't help in terms of performance or
memory.
  • Loading branch information
Lbird committed Jun 9, 2020
1 parent 1735fa9 commit 49fcfc0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions nodedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,11 +767,9 @@ func (ndb *nodeDB) saveRoot(hash []byte, version int64, flushToDisk bool) error

key := ndb.rootKey(version)
ndb.updateLatestVersion(version)
ndb.recentBatch.Set(key, hash)
if flushToDisk {
ndb.snapshotBatch.Set(key, hash)
ndb.recentBatch.Delete(key)
} else {
ndb.recentBatch.Set(key, hash)
}

return nil
Expand Down

0 comments on commit 49fcfc0

Please sign in to comment.