cleanup
This commit is contained in:
parent
e0604baad5
commit
1e6d9bcac6
|
@ -84,12 +84,14 @@ func NewStore(dbName string, cacheSize int, logger log.Logger) (*Store, error) {
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Height gets the last height stored in the database
|
||||||
func (s *Store) Height() uint64 {
|
func (s *Store) Height() uint64 {
|
||||||
return s.State.Committed().Tree.LatestVersion()
|
return s.State.LatestHeight()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hash gets the last hash stored in the database
|
||||||
func (s *Store) Hash() []byte {
|
func (s *Store) Hash() []byte {
|
||||||
return s.State.Committed().Tree.Hash()
|
return s.State.LatestHash()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Info implements abci.Application. It returns the height, hash and size (in the data).
|
// Info implements abci.Application. It returns the height, hash and size (in the data).
|
||||||
|
|
|
@ -37,6 +37,14 @@ func (s State) Check() SimpleDB {
|
||||||
return s.checkTx
|
return s.checkTx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s State) LatestHeight() uint64 {
|
||||||
|
return s.committed.Tree.LatestVersion()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s State) LatestHash() []byte {
|
||||||
|
return s.committed.Tree.Hash()
|
||||||
|
}
|
||||||
|
|
||||||
// BatchSet is used for some weird magic in storing the new height
|
// BatchSet is used for some weird magic in storing the new height
|
||||||
func (s *State) BatchSet(key, value []byte) {
|
func (s *State) BatchSet(key, value []byte) {
|
||||||
if s.persistent {
|
if s.persistent {
|
||||||
|
|
Loading…
Reference in New Issue