pool

package
v2.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFetcher

func NewFetcher(address string, f syncer.Fetcher) *fetcher

Types

type BCPool

type BCPool struct {
	Id string
	// contains filtered or unexported fields
}

func (*BCPool) AddBlock

func (self *BCPool) AddBlock(block common.Block)

func (*BCPool) AddDirectBlock

func (self *BCPool) AddDirectBlock(block common.Block) error

func (*BCPool) AddTail

func (self *BCPool) AddTail(block common.Block) error

func (*BCPool) CurrentChain

func (self *BCPool) CurrentChain() Chain

func (*BCPool) CurrentModifyToChain

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

func (*BCPool) ExistInCurrent

func (self *BCPool) ExistInCurrent(request face.FetchRequest) bool

func (*BCPool) LongestChain

func (self *BCPool) LongestChain() Chain

func (*BCPool) Rollback

func (self *BCPool) Rollback(rollbackHeight uint64, rollbackHash string) error
func (self *BCPool) Rollback(new common.Block) error {
	return self.chainpool.rollback(new.Height())
}

type BlockPool

type BlockPool interface {
	face.PoolWriter
	face.PoolReader
	Start()
	Stop()
	Init(syncer.Fetcher)
	Info(string) string
}

func NewPool

func NewPool(bc ch.BlockChain, rwMutex *sync.RWMutex) BlockPool

type BlockVerifySuccessStat

type BlockVerifySuccessStat struct {
}

func (*BlockVerifySuccessStat) Reset

func (self *BlockVerifySuccessStat) Reset()

func (*BlockVerifySuccessStat) VerifyResult

func (self *BlockVerifySuccessStat) VerifyResult() verifier.VerifyResult

type ByHeight

type ByHeight []*PoolBlock

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() common.Block
	GetBlock(height uint64) common.Block
}

type ChainReader

type ChainReader interface {
	Head() common.Block
	GetBlock(height uint64) common.Block
}

type ForkChainError

type ForkChainError struct {
	What string
}

func (ForkChainError) Error

func (e ForkChainError) Error() string

type PoolBlock

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

type PoolReader

type PoolReader interface {
	Current() Chain
	Chains() []Chain
}

Jump to

Keyboard shortcuts

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