txpool

package
v0.0.0-...-169a2f2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Execution

type Execution interface {
	VerifyTx(tx *core.Transaction) error
}

type MsgService

type MsgService interface {
	SubscribeTxList(buffer int) *emitter.Subscription
	BroadcastTxList(txList *core.TxList) error
	RequestTxList(pubKey *core.PublicKey, hashes [][]byte) (*core.TxList, error)
}

type Status

type Status struct {
	Total   int `json:"total"`
	Pending int `json:"pending"`
	Queue   int `json:"queue"`
}

type Storage

type Storage interface {
	HasTx(hash []byte) bool
}

type TxPool

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

func New

func New(storage Storage, execution Execution, msgSvc MsgService) *TxPool

func (*TxPool) GetStatus

func (pool *TxPool) GetStatus() Status

func (*TxPool) GetTx

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

func (*TxPool) GetTxStatus

func (pool *TxPool) GetTxStatus(hash []byte) TxStatus

func (*TxPool) GetTxsToExecute

func (pool *TxPool) GetTxsToExecute(hashes [][]byte) ([]*core.Transaction, [][]byte)

func (*TxPool) PopTxsFromQueue

func (pool *TxPool) PopTxsFromQueue(max int) [][]byte

func (*TxPool) PutTxsToQueue

func (pool *TxPool) PutTxsToQueue(hashes [][]byte)

func (*TxPool) RemoveTxs

func (pool *TxPool) RemoveTxs(hashes [][]byte)

func (*TxPool) SetTxsPending

func (pool *TxPool) SetTxsPending(hashes [][]byte)

func (*TxPool) SubmitTx

func (pool *TxPool) SubmitTx(tx *core.Transaction) error

func (*TxPool) SyncTxs

func (pool *TxPool) SyncTxs(peer *core.PublicKey, hashes [][]byte) error

type TxStatus

type TxStatus uint8
const (
	TxStatusNotFound TxStatus = iota
	TxStatusQueue
	TxStatusPending
	TxStatusCommited
)

Jump to

Keyboard shortcuts

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