diff --git a/nodedb.go b/nodedb.go index b28b6643d..852f427b3 100644 --- a/nodedb.go +++ b/nodedb.go @@ -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