core

package
v0.0.0-...-ee99c87 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: LGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TransactionPool

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

TransactionPool is a thread-safe container for transactions that received from the network or submitted locally. A transaction will be removed from the pool once included in a blockchain.

func NewTransactionPool

func NewTransactionPool(config TransactionPoolConfig) *TransactionPool

NewTransactionPool creates and returns a transaction pool.

func (*TransactionPool) AddTransaction

func (pool *TransactionPool) AddTransaction(tx *types.Transaction) (bool, error)

AddTransaction adds a single transation into the pool if it is valid and return true. Otherwise, return false and concrete error.

type TransactionPoolConfig

type TransactionPoolConfig struct {
	Capacity uint // Maximum number of transactions in pool.
}

TransactionPoolConfig is the configuration of transaction pool.

func DefaultTxPoolConfig

func DefaultTxPoolConfig() *TransactionPoolConfig

DefaultTxPoolConfig returns the default configuration of transaction pool.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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