Skip to content

Commit

Permalink
Fix saveRoot() to delete root node from recentDB
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbird committed Jun 8, 2020
1 parent 2e3d3bd commit 1735fa9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nodedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,11 @@ 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 1735fa9

Please sign in to comment.