Documentation ¶
Index ¶
- func NewDataSet() *dataSet
- type Cache
- func (cache *Cache) Destroy()
- func (cache *Cache) GetAccountBlockByHash(hash types.Hash) *ledger.AccountBlock
- func (cache *Cache) GetAccountBlockByHeight(addr types.Address, height uint64) *ledger.AccountBlock
- func (cache *Cache) GetGlobalQuota() types.QuotaInfo
- func (cache *Cache) GetLatestAccountBlock(address types.Address) *ledger.AccountBlock
- func (cache *Cache) GetLatestSnapshotBlock() *ledger.SnapshotBlock
- func (cache *Cache) GetQuotaUsedList(addr types.Address) []types.QuotaInfo
- func (cache *Cache) GetSnapshotBlockByHash(hash types.Hash) *ledger.SnapshotBlock
- func (cache *Cache) GetSnapshotBlockByHeight(height uint64) *ledger.SnapshotBlock
- func (cache *Cache) GetSnapshotHeaderByHash(hash types.Hash) *ledger.SnapshotBlock
- func (cache *Cache) GetSnapshotHeaderByHeight(height uint64) *ledger.SnapshotBlock
- func (cache *Cache) GetStatus() []interfaces.DBStatus
- func (cache *Cache) GetUnconfirmedBlocks() []*ledger.AccountBlock
- func (cache *Cache) GetUnconfirmedBlocksByAddress(address *types.Address) []*ledger.AccountBlock
- func (cache *Cache) Init() error
- func (cache *Cache) InsertAccountBlock(block *ledger.AccountBlock)
- func (cache *Cache) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock)
- func (cache *Cache) IsAccountBlockExisted(hash types.Hash) bool
- func (cache *Cache) IsSnapshotBlockExisted(hash types.Hash) bool
- func (cache *Cache) ResetUnconfirmedQuotas(unconfirmedBlocks []*ledger.AccountBlock)
- func (cache *Cache) RollbackAccountBlocks(accountBlocks []*ledger.AccountBlock) error
- func (cache *Cache) RollbackSnapshotBlocks(deletedChunks []*ledger.SnapshotChunk, ...) error
- type Chain
- type UnconfirmedPool
- func (up *UnconfirmedPool) DeleteAllBlocks()
- func (up *UnconfirmedPool) DeleteBlocks(blocks []*ledger.AccountBlock)
- func (up *UnconfirmedPool) GetBlocks() []*ledger.AccountBlock
- func (up *UnconfirmedPool) GetBlocksByAddress(addr *types.Address) []*ledger.AccountBlock
- func (up *UnconfirmedPool) InsertAccountBlock(block *ledger.AccountBlock)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDataSet ¶
func NewDataSet() *dataSet
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
func (*Cache) GetAccountBlockByHash ¶
func (cache *Cache) GetAccountBlockByHash(hash types.Hash) *ledger.AccountBlock
func (*Cache) GetAccountBlockByHeight ¶
func (*Cache) GetLatestAccountBlock ¶
func (cache *Cache) GetLatestAccountBlock(address types.Address) *ledger.AccountBlock
func (*Cache) GetLatestSnapshotBlock ¶
func (cache *Cache) GetLatestSnapshotBlock() *ledger.SnapshotBlock
func (*Cache) GetQuotaUsedList ¶
func (*Cache) GetSnapshotBlockByHash ¶
func (cache *Cache) GetSnapshotBlockByHash(hash types.Hash) *ledger.SnapshotBlock
func (*Cache) GetSnapshotBlockByHeight ¶
func (cache *Cache) GetSnapshotBlockByHeight(height uint64) *ledger.SnapshotBlock
func (*Cache) GetSnapshotHeaderByHash ¶
func (cache *Cache) GetSnapshotHeaderByHash(hash types.Hash) *ledger.SnapshotBlock
func (*Cache) GetSnapshotHeaderByHeight ¶
func (cache *Cache) GetSnapshotHeaderByHeight(height uint64) *ledger.SnapshotBlock
func (*Cache) GetStatus ¶
func (cache *Cache) GetStatus() []interfaces.DBStatus
func (*Cache) GetUnconfirmedBlocks ¶
func (cache *Cache) GetUnconfirmedBlocks() []*ledger.AccountBlock
func (*Cache) GetUnconfirmedBlocksByAddress ¶
func (cache *Cache) GetUnconfirmedBlocksByAddress(address *types.Address) []*ledger.AccountBlock
func (*Cache) InsertAccountBlock ¶
func (cache *Cache) InsertAccountBlock(block *ledger.AccountBlock)
func (*Cache) InsertSnapshotBlock ¶
func (cache *Cache) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock, confirmedBlocks []*ledger.AccountBlock)
func (*Cache) IsAccountBlockExisted ¶
func (*Cache) IsSnapshotBlockExisted ¶
func (*Cache) ResetUnconfirmedQuotas ¶
func (cache *Cache) ResetUnconfirmedQuotas(unconfirmedBlocks []*ledger.AccountBlock)
func (*Cache) RollbackAccountBlocks ¶
func (cache *Cache) RollbackAccountBlocks(accountBlocks []*ledger.AccountBlock) error
func (*Cache) RollbackSnapshotBlocks ¶
func (cache *Cache) RollbackSnapshotBlocks(deletedChunks []*ledger.SnapshotChunk, unconfirmedBlocks []*ledger.AccountBlock) error
type Chain ¶
type Chain interface { QueryLatestSnapshotBlock() (*ledger.SnapshotBlock, error) QuerySnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) GetSubLedger(endHeight, startHeight uint64) ([]*ledger.SnapshotChunk, error) GetSubLedgerAfterHeight(height uint64) ([]*ledger.SnapshotChunk, error) }
type UnconfirmedPool ¶
type UnconfirmedPool struct {
// contains filtered or unexported fields
}
func NewUnconfirmedPool ¶
func NewUnconfirmedPool(ds *dataSet) *UnconfirmedPool
func (*UnconfirmedPool) DeleteAllBlocks ¶
func (up *UnconfirmedPool) DeleteAllBlocks()
func (*UnconfirmedPool) DeleteBlocks ¶
func (up *UnconfirmedPool) DeleteBlocks(blocks []*ledger.AccountBlock)
func (*UnconfirmedPool) GetBlocks ¶
func (up *UnconfirmedPool) GetBlocks() []*ledger.AccountBlock
No lock
func (*UnconfirmedPool) GetBlocksByAddress ¶
func (up *UnconfirmedPool) GetBlocksByAddress(addr *types.Address) []*ledger.AccountBlock
func (*UnconfirmedPool) InsertAccountBlock ¶
func (up *UnconfirmedPool) InsertAccountBlock(block *ledger.AccountBlock)
Click to show internal directories.
Click to hide internal directories.