return hash, nil
}
-// GetBlockHeightIndex return block hashes by given height
-func GetBlockHeightIndex(db dbm.DB, height uint64) ([]*bc.Hash, error) {
+// GetBlockHashesByHeight return block hashes by given height
+func GetBlockHashesByHeight(db dbm.DB, height uint64) ([]*bc.Hash, error) {
binaryHashes := db.Get(calcblockHeightIndexPrefix(height))
if binaryHashes == nil {
return nil, fmt.Errorf("There are no block hashes with given height %s", height)
}
fillHeightIndexFn := func(height uint64) ([]*bc.Hash, error) {
- return GetBlockHeightIndex(db, height)
+ return GetBlockHashesByHeight(db, height)
}
fillMainChainHashFn := func(height uint64) (*bc.Hash, error) {
return s.blockIndex.GetBlockHashByHeight(height)
}
-// GetBlockHeightIndex return the block hash by the specified height
-func (s *Store) GetBlockHeightIndex(height uint64) ([]*bc.Hash, error) {
+// GetBlockHashesByHeight return the block hash by the specified height
+func (s *Store) GetBlockHashesByHeight(height uint64) ([]*bc.Hash, error) {
return s.blockIndex.GetBlockHashesByHeight(height)
}
return errInvalidSignature
}
- blockHashes, err := c.consensusNodeManager.store.GetBlockHeightIndex(bh.Height)
+ blockHashes, err := c.consensusNodeManager.store.GetBlockHashesByHeight(bh.Height)
if err != nil {
return err
}
c.cond.L.Lock()
defer c.cond.L.Unlock()
//check double sign in same block height
- blockHashes, err := c.consensusNodeManager.store.GetBlockHeightIndex(block.Height)
+ blockHashes, err := c.consensusNodeManager.store.GetBlockHashesByHeight(block.Height)
if err != nil {
return nil, err
}
GetVoteResult(uint64) (*state.VoteResult, error)
GetBlockHashByHeight(uint64) (*bc.Hash, error)
- GetBlockHeightIndex(uint64) ([]*bc.Hash, error)
+ GetBlockHashesByHeight(uint64) ([]*bc.Hash, error)
GetBlockNode(*bc.Hash) (*state.BlockNode, error)
SaveBlock(*types.Block, *bc.TransactionStatus) error
SaveBlockHeader(*types.BlockHeader) error