mempool

package
v0.0.0-...-d9e9b57 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SerializeTxPool

func SerializeTxPool(pool *TxPool) []byte

SerializeTxPool serializes a txpool for []byte

Types

type TxPool

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

func DeserializeTxPool

func DeserializeTxPool(data []byte) (*TxPool, error)

DeserializeTxPool deserializes a txpool

func New

func New(bc *chain.Blockchain) *TxPool

New returns a new memory pool for validating and storing standalone transactions until they are mined into a block.

func (*TxPool) Count

func (mp *TxPool) Count() int

Count returns the number of transactions in the main pool. It does not include the orphan pool.

This function is safe for concurrent access.

func (*TxPool) GetTransaction

func (mp *TxPool) GetTransaction(hash string) (*chain.Transaction, bool)

GetTransaction get transaction info from txpool

func (*TxPool) HaveTransaction

func (mp *TxPool) HaveTransaction(hash string) bool

HaveTransaction returns whether or not the passed transaction already exists in the main pool or in the orphan pool.

func (*TxPool) IsOrphanInPool

func (mp *TxPool) IsOrphanInPool(hash string) bool

IsOrphanInPool returns whether or not the passed transaction already exists in the orphan pool.

This function is safe for concurrent access.

func (*TxPool) IsTransactionInPool

func (mp *TxPool) IsTransactionInPool(hash string) bool

IsTransactionInPool returns whether or not the passed transaction already exists in the main pool.

This function is safe for concurrent access.

func (*TxPool) MaybeAcceptTransaction

func (mp *TxPool) MaybeAcceptTransaction(tx *chain.Transaction) ([]*hashx.Hash, error)

MaybeAcceptTransaction is for handling insertion of new transactions into a mempool.

func (*TxPool) ProcessTransaction

func (mp *TxPool) ProcessTransaction(tx *chain.Transaction, allowOrphan bool) error

ProcessTransaction is the main workhorse for handling insertion of new transactions into the mempool.

func (*TxPool) RemoveOrphan

func (mp *TxPool) RemoveOrphan(tx *chain.Transaction)

RemoveOrphan removes the passed orphan transaction from the orphan pool and previous orphan index.

This function is safe for concurrent access.

func (*TxPool) RemoveTransaction

func (mp *TxPool) RemoveTransaction(tx *chain.Transaction)

RemoveTransaction removes the passed transaction from the mempool.

func (*TxPool) TxDescs

func (mp *TxPool) TxDescs() []*chain.Transaction

TxDescs returns a slice of descriptors for all the transactions in the pool. The descriptors are to be treated as read only.

This function is safe for concurrent access.

func (*TxPool) TxHashes

func (mp *TxPool) TxHashes() [][]byte

TxHashes returns a slice of hashes for all of the transactions in the memory pool.

This function is safe for concurrent access.

Jump to

Keyboard shortcuts

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