MCPcopy Create free account
hub / github.com/DNAProject/DNA / GetBestBlock

Method GetBestBlock

validator/db/store.go:113–121  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111}
112
113func (self *Store) GetBestBlock() (BestBlock, error) {
114 if self.bestBlockHeader == nil {
115 return BestBlock{}, errors.New("fresh db")
116 }
117 return BestBlock{
118 Height: self.bestBlockHeader.Height,
119 Hash: self.bestBlockHeader.Hash(),
120 }, nil
121}
122
123func (self *Store) GetBestHeader() (*types.Header, error) {
124 if self.bestBlockHeader == nil {

Callers 1

TestNewStoreFunction · 0.95

Calls 1

HashMethod · 0.65

Tested by 1

TestNewStoreFunction · 0.76