chain_db

package
v2.6.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: GPL-3.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

func NewStore

func NewStore(dataDir string, name string) (*Store, error)

func NewStoreWithDb

func NewStoreWithDb(dataDir string, name string, diskStore *leveldb.DB) (*Store, error)

func (*Store) AfterCommit

func (store *Store) AfterCommit()

assume lock write when call after commit

func (*Store) AfterRecover

func (store *Store) AfterRecover()

func (*Store) BeforeRecover

func (store *Store) BeforeRecover([]byte)

func (*Store) CancelPrepare

func (store *Store) CancelPrepare()

assume lock write when cancel prepare

func (*Store) Clean

func (store *Store) Clean() error

func (*Store) Close

func (store *Store) Close() error

func (*Store) Commit

func (store *Store) Commit() error

func (*Store) CompactRange

func (store *Store) CompactRange(r util.Range) error

func (*Store) Get

func (store *Store) Get(key []byte) ([]byte, error)

func (*Store) GetOriginal

func (store *Store) GetOriginal(key []byte) ([]byte, error)

func (*Store) GetStatus

func (store *Store) GetStatus() []interfaces.DBStatus

func (*Store) Has

func (store *Store) Has(key []byte) (bool, error)

func (*Store) Id

func (store *Store) Id() types.Hash

func (*Store) NewBatch

func (store *Store) NewBatch() *leveldb.Batch

func (*Store) NewIterator

func (store *Store) NewIterator(slice *util.Range) interfaces.StorageIterator

func (*Store) PatchRedoLog

func (store *Store) PatchRedoLog(redoLog []byte) error

func (*Store) Prepare

func (store *Store) Prepare()

assume lock write when prepare

func (*Store) RedoLog

func (store *Store) RedoLog() ([]byte, error)

func (*Store) RegisterAfterRecover

func (store *Store) RegisterAfterRecover(f func())

func (*Store) RollbackAccountBlockByHash

func (store *Store) RollbackAccountBlockByHash(rollbackBatch *leveldb.Batch, blockHashList []types.Hash)

rollback

func (*Store) RollbackAccountBlocks

func (store *Store) RollbackAccountBlocks(rollbackBatch *leveldb.Batch, accountBlocks []*ledger.AccountBlock)

rollback

func (*Store) RollbackSnapshot

func (store *Store) RollbackSnapshot(rollbackBatch *leveldb.Batch)

func (*Store) WriteAccountBlock

func (store *Store) WriteAccountBlock(batch *leveldb.Batch, block *ledger.AccountBlock)

func (*Store) WriteAccountBlockByHash

func (store *Store) WriteAccountBlockByHash(batch *leveldb.Batch, blockHash types.Hash)

func (*Store) WriteDirectly

func (store *Store) WriteDirectly(batch *leveldb.Batch)

func (*Store) WriteSnapshot

func (store *Store) WriteSnapshot(snapshotBatch *leveldb.Batch, accountBlocks []*ledger.AccountBlock)

snapshot

func (*Store) WriteSnapshotByHash

func (store *Store) WriteSnapshotByHash(snapshotBatch *leveldb.Batch, blockHashList []types.Hash)

snapshot

type UnconfirmedBatchs

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

func NewUnconfirmedBatchs

func NewUnconfirmedBatchs() *UnconfirmedBatchs

func (*UnconfirmedBatchs) All

func (ub *UnconfirmedBatchs) All(f func(batch *leveldb.Batch))

func (*UnconfirmedBatchs) Clear

func (ub *UnconfirmedBatchs) Clear()

func (*UnconfirmedBatchs) Get

func (ub *UnconfirmedBatchs) Get(blockHash types.Hash) (*leveldb.Batch, bool)

func (*UnconfirmedBatchs) Put

func (ub *UnconfirmedBatchs) Put(blockHash types.Hash, batch *leveldb.Batch)

func (*UnconfirmedBatchs) Remove

func (ub *UnconfirmedBatchs) Remove(blockHash types.Hash)

func (*UnconfirmedBatchs) Size

func (ub *UnconfirmedBatchs) Size() int

Jump to

Keyboard shortcuts

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