Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
[R4R] Add set version in mutable tree (#8)
Browse files Browse the repository at this point in the history
* add set version

* set latest version
  • Loading branch information
yutianwu authored Jun 18, 2019
1 parent 0ac2dfe commit ad09593
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions mutable_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ func (tree *MutableTree) Load() (int64, error) {
return tree.LoadVersion(int64(0))
}

// SetVersion set current version of the tree. Only used in upgrade
func (tree *MutableTree) SetVersion(version int64) {
tree.version = version
tree.ndb.latestVersion = version
}

// Returns the version number of the latest version found
func (tree *MutableTree) LoadVersion(targetVersion int64) (int64, error) {
roots, err := tree.ndb.getRoots()
Expand Down

0 comments on commit ad09593

Please sign in to comment.