mempool

package
v0.10.0-rc Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2019 License: MIT Imports: 24 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemPool

type MemPool struct {
	*component.BaseComponent

	sync.RWMutex
	// contains filtered or unexported fields
}

MemPool is main structure of mempool service

func NewMemPoolService

func NewMemPoolService(cfg *cfg.Config, cs *chain.ChainService) *MemPool

NewMemPoolService create and return new MemPool

func (*MemPool) AfterStart

func (mp *MemPool) AfterStart()

func (*MemPool) BeforeStart

func (mp *MemPool) BeforeStart()

Start runs mempool servivce

func (*MemPool) BeforeStop

func (mp *MemPool) BeforeStop()

Stop handles clean-up for mempool service

func (*MemPool) Receive

func (mp *MemPool) Receive(context actor.Context)

Receive handles requested messages from other services

func (*MemPool) Size

func (mp *MemPool) Size() (int, int)

Size returns current maintaining number of transactions and number of orphan transaction

func (*MemPool) Statistics

func (mp *MemPool) Statistics() *map[string]interface{}

type TxList

type TxList struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

TxList is internal struct for transactions per account

func NewTxList

func NewTxList(acc []byte, st *types.State) *TxList

NewTxList creates new TxList with given State

func (*TxList) Empty

func (tl *TxList) Empty() bool

Empty check TxList is empty including orphan

func (*TxList) FilterByState added in v0.8.1

func (tl *TxList) FilterByState(st *types.State, coinbasefee *big.Int) (int, []*types.Tx)

SetMinNonce sets new minimum nonce for TxList evict on some transactions is possible due to minimum nonce

func (*TxList) Get

func (tl *TxList) Get() []*types.Tx

Get returns processible transactions

func (*TxList) GetAccount

func (tl *TxList) GetAccount() []byte

func (*TxList) GetAll

func (tl *TxList) GetAll() []*types.Tx

GetAll returns all transactions including orphans

func (*TxList) GetLastModifiedTime added in v0.9.0

func (tl *TxList) GetLastModifiedTime() time.Time

func (*TxList) Len

func (tl *TxList) Len() int

Len returns number of transactios which are ready to be processed

func (*TxList) Put

func (tl *TxList) Put(tx *types.Tx) (int, error)

Put inserts transaction into TxList if transaction is processible, it is appended to list if not, transaction is managed as orphan

type TxVerifier

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

func NewTxVerifier

func NewTxVerifier(p *MemPool) *TxVerifier

func (*TxVerifier) Receive

func (s *TxVerifier) Receive(context actor.Context)

Receive actor message

Jump to

Keyboard shortcuts

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