pool

package
v0.0.0-...-5d05a64 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PriorityQueue

type PriorityQueue []*TransactionInfo

func (*PriorityQueue) Contains

func (pq *PriorityQueue) Contains(newTI *TransactionInfo) bool

func (PriorityQueue) Full

func (pq PriorityQueue) Full() bool

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() *TransactionInfo

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(newTi *TransactionInfo) error

func (*PriorityQueue) Remove

func (*PriorityQueue) RemoveTxInBlock

func (pq *PriorityQueue) RemoveTxInBlock(block *block.Block)

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type TransactionInfo

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

func CreateTransactionInfo

func CreateTransactionInfo(tx transactions.TransactionInterface, txHash common.Hash,
	blockNumber uint64, timestamp uint64) *TransactionInfo

func (*TransactionInfo) BlockNumber

func (t *TransactionInfo) BlockNumber() uint64

func (*TransactionInfo) CheckOTSExist

func (t *TransactionInfo) CheckOTSExist(tx2 transactions.TransactionInterface) bool

func (*TransactionInfo) IsStale

func (t *TransactionInfo) IsStale(currentBlockHeight uint64) bool

func (*TransactionInfo) Timestamp

func (t *TransactionInfo) Timestamp() uint64

func (*TransactionInfo) Transaction

func (*TransactionInfo) TxHash

func (t *TransactionInfo) TxHash() common.Hash

func (*TransactionInfo) UpdateBlockNumber

func (t *TransactionInfo) UpdateBlockNumber(currentBlockHeight uint64)

type TransactionPool

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

func CreateTransactionPool

func CreateTransactionPool() *TransactionPool

func (*TransactionPool) Add

func (t *TransactionPool) Add(tx transactions.TransactionInterface, txHash common.Hash,
	slotNumber uint64, timestamp uint64) error

func (*TransactionPool) AddNonceData

func (t *TransactionPool) AddNonceData(pk []byte, nonce uint64)

func (*TransactionPool) AddTxFromBlock

func (t *TransactionPool) AddTxFromBlock(block *block.Block, currentBlockHeight uint64) error

func (*TransactionPool) Contains

func (t *TransactionPool) Contains(tx *TransactionInfo) bool

func (*TransactionPool) DeleteNonceData

func (t *TransactionPool) DeleteNonceData(pk []byte, nonce uint64)

func (*TransactionPool) GetNonceByAddress

func (t *TransactionPool) GetNonceByAddress(address common.Address) (uint64, bool)

func (*TransactionPool) IsFull

func (t *TransactionPool) IsFull() bool

func (*TransactionPool) Pop

func (t *TransactionPool) Pop() *TransactionInfo

func (*TransactionPool) Remove

func (*TransactionPool) RemoveTxInBlock

func (t *TransactionPool) RemoveTxInBlock(block *block.Block)

Jump to

Keyboard shortcuts

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