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

Commit

Permalink
Merge pull request #7 from binance-chain/release/v0.12.0-binance.1
Browse files Browse the repository at this point in the history
Release/v0.12.0 binance.1
  • Loading branch information
yutianwu authored Jun 18, 2019
2 parents 65e487d + ad09593 commit b842524
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 6 additions & 4 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 Expand Up @@ -501,7 +507,3 @@ func (tree *MutableTree) addOrphans(orphans []*Node) {
tree.orphans[string(node.hash)] = node.version
}
}

func (tree *MutableTree) GetVersions() map[int64]bool {
return tree.versions
}
4 changes: 4 additions & 0 deletions nodedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ const (
hashSize = tmhash.Size
)

// expose nodeDB so that state sync can directly save serialized node into
// db without restore it as iavl tree first
type NodeDB = nodeDB

var (
// All node keys are prefixed with the byte 'n'. This ensures no collision is
// possible with the other keys, and makes them easier to traverse. They are indexed by the node hash.
Expand Down

0 comments on commit b842524

Please sign in to comment.