leveldb

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 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

func SaveUtxoView

func SaveUtxoView(batch dbm.Batch, view *state.UtxoViewpoint) error

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.BlockStoreStateJSON

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) GetTransactionsUtxo

func (s *Store) GetTransactionsUtxo(view *state.UtxoViewpoint, txs []*bc.Tx) error

GetTransactionsUtxo will return all the utxo that related to the input txs

func (*Store) GetUtxo

func (s *Store) GetUtxo(hash *bc.Hash) (*storage.UtxoEntry, error)

GetUtxo will search the utxo in db

func (*Store) LoadBlockIndex added in v0.4.3

func (s *Store) LoadBlockIndex() (*protocol.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(block *types.Block, view *state.UtxoViewpoint) 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