pool

package
v0.0.0-...-7ede18c Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NonceList

type NonceList []int64

func NewNonceList

func NewNonceList() *NonceList

func (*NonceList) Delete

func (list *NonceList) Delete(nonce int64)

func (*NonceList) Insert

func (list *NonceList) Insert(nonce int64)

type TransactionDict

type TransactionDict struct {
	All map[string]*userevent.Transaction `json:"all"`
	// contains filtered or unexported fields
}

func NewTransactionDict

func NewTransactionDict() *TransactionDict

func (*TransactionDict) Delete

func (dict *TransactionDict) Delete(hash string)

func (*TransactionDict) Get

func (dict *TransactionDict) Get(hash string) *userevent.Transaction

func (TransactionDict) Range

func (dict TransactionDict) Range(f func(hash string, tx *userevent.Transaction) bool)

func (*TransactionDict) Save

func (dict *TransactionDict) Save(tx *userevent.Transaction)

type TxPool

type TxPool struct {
	All      *TransactionDict `json:"All"`
	List     *TxTimedList     `json:"timedList"`
	UsersTxs *UsersTxs        `json:"userTxs"`
}

func NewTxPool

func NewTxPool() *TxPool

func (*TxPool) GetTx

func (pool *TxPool) GetTx(hash []byte) *userevent.Transaction

func (*TxPool) GetUserTxs

func (pool *TxPool) GetUserTxs(address string) *UserTxs

func (*TxPool) Notify

func (pool *TxPool) Notify(txs []userevent.Transaction)

func (*TxPool) Park

func (pool *TxPool) Park(tx *userevent.Transaction, userNonce int64)

func (*TxPool) Pop

func (pool *TxPool) Pop(size int) []*userevent.Transaction

func (*TxPool) Promote

func (pool *TxPool) Promote(statdb MPTPlus.MTP)

type TxTimedList

type TxTimedList struct {
	List []*userevent.Transaction `json:"List"`
	M    map[string]bool          `json:"M"`
	// contains filtered or unexported fields
}

func NewTimedList

func NewTimedList() *TxTimedList

func (*TxTimedList) Notify

func (list *TxTimedList) Notify(tx userevent.Transaction)

func (*TxTimedList) Pop

func (list *TxTimedList) Pop(size int) []*userevent.Transaction

func (*TxTimedList) Put

func (list *TxTimedList) Put(txs ...*userevent.Transaction)

type UserTxs

type UserTxs struct {
	Txs    map[int64]*userevent.Transaction `json:"txs"`
	Nonces *NonceList                       `json:"nonces"`
	Nonce  int64                            `json:"nonce"`
	Index  int                              `json:"index"`
}

func NewUserTxs

func NewUserTxs(nonce int64) *UserTxs

func (*UserTxs) Notify

func (sorted *UserTxs) Notify(nonce int64)

func (*UserTxs) Promote

func (m *UserTxs) Promote(address []byte, nonce int64) ([]*userevent.Transaction, bool)

func (*UserTxs) Remove

func (sorted *UserTxs) Remove(tx userevent.Transaction)

func (*UserTxs) Save

func (sorted *UserTxs) Save(tx *userevent.Transaction) ([]*userevent.Transaction, bool)

type UsersTxs

type UsersTxs struct {
	M map[string]*UserTxs `json:"m"`
	// contains filtered or unexported fields
}

func NewUsersTxs

func NewUsersTxs() *UsersTxs

func (*UsersTxs) Notify

func (*UsersTxs) SaveTx

func (m *UsersTxs) SaveTx(tx *userevent.Transaction, userNonce int64) ([]*userevent.Transaction, bool)

Jump to

Keyboard shortcuts

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