X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=protocol%2Fstore.go;h=f93b1ba7704cab83d349eeb0d57ecd5816929691;hb=489e57ce3c46eb9e8ca25c7e966a1ea26fe41d57;hp=d2d11265a08072d1efa46212fdd0ab0754f3bb85;hpb=908854e2eeebd0e59dd98a872a4858fe4b451955;p=bytom%2Fvapor.git diff --git a/protocol/store.go b/protocol/store.go index d2d11265..f93b1ba7 100644 --- a/protocol/store.go +++ b/protocol/store.go @@ -10,7 +10,7 @@ import ( ) var ( - ErrNotFoundVoteResult = errors.New("can't find the vote result by given sequence") + ErrNotFoundConsensusResult = errors.New("can't find the vote result by given sequence") ) // Store provides storage interface for blockchain data @@ -18,16 +18,18 @@ type Store interface { BlockExist(*bc.Hash) bool GetBlock(*bc.Hash) (*types.Block, error) + GetBlockHeader(*bc.Hash) (*types.BlockHeader, error) GetStoreStatus() *BlockStoreState GetTransactionStatus(*bc.Hash) (*bc.TransactionStatus, error) GetTransactionsUtxo(*state.UtxoViewpoint, []*bc.Tx) error GetUtxo(*bc.Hash) (*storage.UtxoEntry, error) - GetVoteResult(uint64) (*state.VoteResult, error) + GetConsensusResult(uint64) (*state.ConsensusResult, error) + GetMainChainHash(uint64) (*bc.Hash, error) + GetBlockHashesByHeight(uint64) ([]*bc.Hash, error) - LoadBlockIndex(uint64) (*state.BlockIndex, error) SaveBlock(*types.Block, *bc.TransactionStatus) error - SaveChainStatus(*state.BlockNode, *state.BlockNode, *state.UtxoViewpoint, []*state.VoteResult) error - SaveChainNodeStatus(*state.BlockNode, *state.BlockNode) error + SaveBlockHeader(*types.BlockHeader) error + SaveChainStatus(*types.BlockHeader, *types.BlockHeader, []*types.BlockHeader, *state.UtxoViewpoint, []*state.ConsensusResult) error } // BlockStoreState represents the core's db status