Version: v1.1.0 Latest Latest

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: 1




This section is empty.


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


This section is empty.


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

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL