tools

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DuplicateError    = errors.New("duplicate insert")
	BufferIsFullError = errors.New("buffer is full")
)

Functions

This section is empty.

Types

type ListBuffer added in v1.0.0

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

ListBuffer is a Tx list buffer implementation.

func NewListBuffer added in v1.0.0

func NewListBuffer(limit uint64, maxCacheTime uint64) *ListBuffer

NewListBuffer create a Tx list buffer instance

func (*ListBuffer) AddTx added in v1.1.0

func (self *ListBuffer) AddTx(tx *types.Transaction) error

AddTx add an element to list buffer

func (*ListBuffer) GetTx added in v1.1.0

func (self *ListBuffer) GetTx(hash types.Hash) *types.Transaction

GetTx get an element from list buffer

func (*ListBuffer) Len added in v1.0.0

func (self *ListBuffer) Len() int

Len returns the number of txs of ListBuffer.

func (*ListBuffer) NonceInBuffer added in v1.1.0

func (self *ListBuffer) NonceInBuffer(from types.Address) uint64

NonceInBuffer returns the nonce in buffer.

func (*ListBuffer) RemoveOlderTx added in v1.1.0

func (self *ListBuffer) RemoveOlderTx(addr types.Address, nonce uint64)

RemoveOlderTx remove tx nonce less than specified nonce from buffer

func (*ListBuffer) RemoveTimeOutTx added in v1.1.0

func (self *ListBuffer) RemoveTimeOutTx() bool

RemoveTimeOutTx remove an timeout Tx from list buffer, return true if exists timeout Tx.

func (*ListBuffer) RemoveTx added in v1.1.0

func (self *ListBuffer) RemoveTx(hash types.Hash)

RemoveTx remove an element from list buffer

func (*ListBuffer) TimedTxGroups added in v1.1.0

func (self *ListBuffer) TimedTxGroups() map[types.Address]*list.List

TimedTxGroups returns the tx groups of ListBuffer.

type TimedTransaction added in v1.1.0

type TimedTransaction struct {
	Tx        *types.Transaction
	TimeStamp time.Time
}

TimedTransaction contains a transaction with the time added to buffer

Jump to

Keyboard shortcuts

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