leveldb

package
v0.0.0-...-c7fad54 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: AGPL-3.0 Imports: 16 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.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) 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

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, 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