func (bs *BlockStore) LoadBlock(height int64) *types.Block {
	var blockMeta = bs.LoadBlockMeta(height)
	if blockMeta == nil {
		return nil
	}
	var block = new(types.Block)
	buf := []byte{}
	for i := 0; i < blockMeta.BlockID.PartsHeader.Total; i++ {
		part := bs.LoadBlockPart(height, i)
		buf = append(buf, part.Bytes...)
	}
	err := cdc.UnmarshalBinaryLengthPrefixed(buf, block)
	if err != nil {
		panic(cmn.ErrorWrap(err, "Error reading block"))
	}
	return block
}
LoadBlock returns the block with the given height.
If no block is found for that height, it returns nil.
package blockchain
import (
	"fmt"
	"sync"
	cmn "github.com/XuanMaoSecLab/DolphinChain/libs/common"
	dbm "github.com/XuanMaoSecLab/DolphinChain/libs/db"
	"github.com/XuanMaoSecLab/DolphinChain/types"
)
type BlockStore struct {
	db dbm.DB
	mtx    sync.RWMutex
	height int64
}
func NewBlockStore(db dbm.DB) *BlockStore {
	bsjson := LoadBlockStoreStateJSON(db)
	return &BlockStore{
		height: bsjson.Height,
		db:     db,
	}
}
func (bs *BlockStore) Height() int64 {
	bs.mtx.RLock()
	defer bs.mtx.RUnlock()
	return bs.height
}