mempool

package
v0.0.0-...-868bdbc Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: AGPL-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 MemPool

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

MemPool ...

func GetMemPool

func GetMemPool() *MemPool

GetMemPool ..

func (*MemPool) AddTx

func (m *MemPool) AddTx(tx *protobuf.Tx, accSrv account.ServiceI) (int, int)

AddTx adds the tx Transaction to the MemPool and returns the total number of current Transactions within the MemPool

func (*MemPool) DeleteTx

func (m *MemPool) DeleteTx(id string) bool

DeleteTx deletes a transaction currently in the MemPool by the transaction ID Returns true if successfully cancelled, false if can't find or cancel the transaction

func (*MemPool) GetTx

func (m *MemPool) GetTx(id string) (int, *protobuf.Tx, error)

GetTx returns a Tx for the given ID or nil if the corresponding TX exists Returns empty if Tx not found

func (*MemPool) GetTxs

func (m *MemPool) GetTxs() *tx.Txs

GetTxs gets all transactions from the MemPool

func (*MemPool) RemoveTxs

func (m *MemPool) RemoveTxs(i int)

RemoveTxs transactions from the MemPool

func (*MemPool) UpdateTx

func (m *MemPool) UpdateTx(origI int, updated *protobuf.Tx) (*protobuf.Tx, error)

UpdateTx receives a Tx (newTx) and updates the corresponding Tx (origTx) with all non-empty fields in newTx

type Service

type Service interface {
	AddTx(tx.Tx) int
	GetTxs() *tx.Txs
	RemoveTxs(int)
}

Service ...

Jump to

Keyboard shortcuts

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