pool

package
v0.0.3-chain Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: GPL-3.0 Imports: 22 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BCPool

type BCPool struct {
	Id string

	LIMIT_HEIGHT      uint64
	LIMIT_LONGEST_NUM uint64
	// contains filtered or unexported fields
}

func (*BCPool) AddBlock

func (self *BCPool) AddBlock(block commonBlock)

func (*BCPool) CurrentChain

func (self *BCPool) CurrentChain() Chain

func (*BCPool) CurrentModifyToChain

func (self *BCPool) CurrentModifyToChain(target Chain) error

func (*BCPool) CurrentModifyToEmpty

func (self *BCPool) CurrentModifyToEmpty() error

func (*BCPool) LongestChain

func (self *BCPool) LongestChain() Chain

type BlockPool

type BlockPool interface {
	PoolWriter
	PoolReader
	Start()
	Stop()
	// todo need use subscribe net
	Init(s syncer)
	Info(addr *types.Address) string
}

func NewPool

func NewPool(bc ch.Chain) BlockPool

type ByHeight

type ByHeight []commonBlock

func (ByHeight) Len

func (a ByHeight) Len() int

func (ByHeight) Less

func (a ByHeight) Less(i, j int) bool

func (ByHeight) Swap

func (a ByHeight) Swap(i, j int)

type ByTailHeight

type ByTailHeight []*snippetChain

func (ByTailHeight) Len

func (a ByTailHeight) Len() int

func (ByTailHeight) Less

func (a ByTailHeight) Less(i, j int) bool

func (ByTailHeight) Swap

func (a ByTailHeight) Swap(i, j int)

type Chain

type Chain interface {
	HeadHeight() uint64
	ChainId() string
	Head() commonBlock
	GetBlock(height uint64) commonBlock
}

type ChainReader

type ChainReader interface {
	Head() commonBlock
	GetBlock(height uint64) commonBlock
}

type ForkChainError

type ForkChainError struct {
	What string
}

func (ForkChainError) Error

func (e ForkChainError) Error() string

type ForkVersion

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

func (*ForkVersion) Inc

func (self *ForkVersion) Inc()

func (*ForkVersion) String

func (self *ForkVersion) String() string

func (*ForkVersion) Val

func (self *ForkVersion) Val() int

type PoolReader

type PoolReader interface {
	// received block in current? (key is requestHash)
	ExistInPool(address types.Address, requestHash types.Hash) bool
}

type PoolWriter

type PoolWriter interface {
	// for normal account
	AddDirectAccountBlock(address types.Address, vmAccountBlock *vm_context.VmAccountBlock) error

	// for contract account
	AddDirectAccountBlocks(address types.Address, received *vm_context.VmAccountBlock, sendBlocks []*vm_context.VmAccountBlock) error
}

type SnapshotProducerWriter

type SnapshotProducerWriter interface {
	Lock()

	UnLock()

	AddDirectSnapshotBlock(block *ledger.SnapshotBlock) error

	RollbackAccountTo(addr types.Address, hash types.Hash, height uint64) error
}

Jump to

Keyboard shortcuts

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