onroad_pool

package
v2.10.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: GPL-3.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OnRoadPool
	ErrOnRoadPoolNotAvailable         = errors.New("target gid's onRoadPool is not available")
	ErrCheckIsCallerFrontOnRoadFailed = errors.New("onRoadPool check the Caller's front onroad hash failed")

	//panic
	ErrLoadCallerCacheFailed = errors.New("load callerCache failed")
	ErrFindCompleteBlock     = errors.New("failed to find complete block by hash")
)

Functions

func NewCallerCache

func NewCallerCache() *callerCache

Types

type OnRoadBlock

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

func LedgerBlockToOnRoad

func LedgerBlockToOnRoad(chain chainReader, block *ledger.AccountBlock) (*OnRoadBlock, error)

type OnRoadPool

type OnRoadPool interface {
	InsertAccountBlocks(orAddr types.Address, blocks []*ledger.AccountBlock) error
	DeleteAccountBlocks(orAddr types.Address, blocks []*ledger.AccountBlock) error

	GetOnRoadTotalNumByAddr(addr types.Address) (uint64, error)
	GetFrontOnRoadBlocksByAddr(addr types.Address) ([]*ledger.AccountBlock, error)

	IsFrontOnRoadOfCaller(orAddr, caller types.Address, hash types.Hash) (bool, error)
	Info() map[string]interface{}
}

func NewContractOnRoadPool

func NewContractOnRoadPool(gid types.Gid, chain chainReader) OnRoadPool

type PendingOnRoadList

type PendingOnRoadList []*OnRoadBlock

func (PendingOnRoadList) Len

func (pList PendingOnRoadList) Len() int

func (PendingOnRoadList) Less

func (pList PendingOnRoadList) Less(i, j int) bool

func (PendingOnRoadList) Swap

func (pList PendingOnRoadList) Swap(i, j int)

Jump to

Keyboard shortcuts

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