leveldb

package
v1.0.5-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2018 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlock

func GetBlock(db dbm.DB, hash *bc.Hash) *types.Block

GetBlock return the block by given hash

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

A Store encapsulates storage for blockchain validation. It satisfies the interface protocol.Store, and provides additional methods for querying current data.

func NewStore

func NewStore(db dbm.DB) *Store

NewStore creates and returns a new Store object.

func (*Store) BlockExist

func (s *Store) BlockExist(hash *bc.Hash) bool

BlockExist check if the block is stored in disk

func (*Store) GetBlock

func (s *Store) GetBlock(hash *bc.Hash) (*types.Block, error)

GetBlock return the block by given hash

func (*Store) GetStoreStatus

func (s *Store) GetStoreStatus() *protocol.BlockStoreState

GetStoreStatus return the BlockStoreStateJSON

func (*Store) GetTransactionStatus

func (s *Store) GetTransactionStatus(hash *bc.Hash) (*bc.TransactionStatus, error)

GetTransactionStatus will return the utxo that related to the block hash

func (*Store) LoadBlockIndex

func (s *Store) LoadBlockIndex() (*state.BlockIndex, error)

func (*Store) SaveBlock

func (s *Store) SaveBlock(block *types.Block, ts *bc.TransactionStatus) error

SaveBlock persists a new block in the protocol.

func (*Store) SaveChainStatus

func (s *Store) SaveChainStatus(node *state.BlockNode) error

SaveChainStatus save the core's newest status && delete old status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL