Documentation ¶
Index ¶
- func GetFragHeadHeightFromDbKey(dbKey []byte) uint64
- func GetFragTailHeightFromDbKey(dbKey []byte) uint64
- func NewAccountTypeCache()
- type AdditionItem
- type AdditionList
- func (al *AdditionList) Add(block *ledger.SnapshotBlock, quota uint64)
- func (al *AdditionList) DeleteStartWith(batch *leveldb.Batch, block *ledger.SnapshotBlock) error
- func (al *AdditionList) GetAggregateQuota(block *ledger.SnapshotBlock) (uint64, error)
- func (al *AdditionList) Start()
- func (al *AdditionList) Stop()
- type Chain
- type Fragment
- type NeedSnapshotBlock
- type NeedSnapshotCache
- func (nsCache *NeedSnapshotCache) Build()
- func (nsCache *NeedSnapshotCache) GetBlockByHash(addr types.Address, hashHeight *ledger.HashHeight) *ledger.AccountBlock
- func (nsCache *NeedSnapshotCache) GetSnapshotContent() ledger.SnapshotContent
- func (nsCache *NeedSnapshotCache) HasSnapshot(subLedger ledger.SnapshotContent) (uint64, error)
- func (nsCache *NeedSnapshotCache) InsertAccountBlock(block *ledger.AccountBlock) error
- func (nsCache *NeedSnapshotCache) NeedReSnapshot(subLedger map[types.Address][]*ledger.AccountBlock) error
- func (nsCache *NeedSnapshotCache) NotSnapshot(horizontalLine map[types.Address]*ledger.AccountBlock)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAccountTypeCache ¶ added in v1.3.0
func NewAccountTypeCache()
Types ¶
type AdditionItem ¶
type AdditionItem struct { Quota uint64 AggregateQuota uint64 SnapshotHashHeight *ledger.HashHeight }
func (*AdditionItem) DeProto ¶
func (ai *AdditionItem) DeProto(pb *vitepb.SnapshotAdditionalItem)
func (*AdditionItem) Proto ¶
func (ai *AdditionItem) Proto() *vitepb.SnapshotAdditionalItem
type AdditionList ¶
type AdditionList struct {
// contains filtered or unexported fields
}
func NewAdditionList ¶
func NewAdditionList(chain Chain) (*AdditionList, error)
func (*AdditionList) Add ¶
func (al *AdditionList) Add(block *ledger.SnapshotBlock, quota uint64)
func (*AdditionList) DeleteStartWith ¶
func (al *AdditionList) DeleteStartWith(batch *leveldb.Batch, block *ledger.SnapshotBlock) error
func (*AdditionList) GetAggregateQuota ¶
func (al *AdditionList) GetAggregateQuota(block *ledger.SnapshotBlock) (uint64, error)
func (*AdditionList) Start ¶
func (al *AdditionList) Start()
func (*AdditionList) Stop ¶
func (al *AdditionList) Stop()
type Chain ¶
type Chain interface { GetUnConfirmedSubLedger() (map[types.Address][]*ledger.AccountBlock, error) GetUnConfirmedPartSubLedger(addrList []types.Address) (map[types.Address][]*ledger.AccountBlock, error) GetLatestSnapshotBlock() *ledger.SnapshotBlock GetConfirmSubLedgerBySnapshotBlocks(snapshotBlocks []*ledger.SnapshotBlock) (map[types.Address][]*ledger.AccountBlock, error) GetSnapshotBlocksByHeight(height uint64, count uint64, forward, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error) ChainDb() *chain_db.ChainDb }
type Fragment ¶
type Fragment struct { HeadHeight uint64 TailHeight uint64 List []*AdditionItem }
func (*Fragment) Deserialize ¶
type NeedSnapshotBlock ¶
type NeedSnapshotBlock struct { Block *ledger.AccountBlock AccumulateQuota uint64 }
type NeedSnapshotCache ¶
type NeedSnapshotCache struct {
// contains filtered or unexported fields
}
func NewNeedSnapshotCache ¶
func NewNeedSnapshotCache(chain Chain) *NeedSnapshotCache
func (*NeedSnapshotCache) Build ¶
func (nsCache *NeedSnapshotCache) Build()
func (*NeedSnapshotCache) GetBlockByHash ¶
func (nsCache *NeedSnapshotCache) GetBlockByHash(addr types.Address, hashHeight *ledger.HashHeight) *ledger.AccountBlock
func (*NeedSnapshotCache) GetSnapshotContent ¶
func (nsCache *NeedSnapshotCache) GetSnapshotContent() ledger.SnapshotContent
func (*NeedSnapshotCache) HasSnapshot ¶
func (nsCache *NeedSnapshotCache) HasSnapshot(subLedger ledger.SnapshotContent) (uint64, error)
func (*NeedSnapshotCache) InsertAccountBlock ¶
func (nsCache *NeedSnapshotCache) InsertAccountBlock(block *ledger.AccountBlock) error
func (*NeedSnapshotCache) NeedReSnapshot ¶
func (nsCache *NeedSnapshotCache) NeedReSnapshot(subLedger map[types.Address][]*ledger.AccountBlock) error
func (*NeedSnapshotCache) NotSnapshot ¶
func (nsCache *NeedSnapshotCache) NotSnapshot(horizontalLine map[types.Address]*ledger.AccountBlock)
Click to show internal directories.
Click to hide internal directories.