transactionpool

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TransactionPoolFeeExponentiation defines the polynomial rate of growth
	// required to keep putting transactions into the transaction pool. If the
	// exponentiation is 2, then doubling the size of the transaction pool
	// requires quadrupling the fees of the transactions being added. A higher
	// number makes it harder for the transaction pool to grow beyond its
	// default size during times of congestion.
	TransactionPoolExponentiation = 3

	// TransactionPoolSizeTarget defines the target size of the pool when the
	// transactions are paying 1 SC / kb in fees.
	TransactionPoolSizeTarget = 3e6

	// TransactionPoolSizeForFee defines how large the transaction pool needs to
	// be before it starts expecting fees to be on the transaction. This initial
	// limit is to help the network grow and provide some wiggle room for
	// wallets that are not yet able to operate via a fee market.
	TransactionPoolSizeForFee = 500e3
)

Constants related to the size and ease-of-entry of the transaction pool.

Variables

This section is empty.

Functions

This section is empty.

Types

type ObjectID added in v1.0.0

type ObjectID crypto.Hash

ObjectIDs are the IDs of objects such as siacoin outputs and file contracts, and are used to see if there are conflicts or overlaps within the transaction pool. A TransactionSetID is the hash of a transaction set.

type TransactionPool

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

The TransactionPool tracks incoming transactions, accepting them or rejecting them based on internal criteria such as fees and unconfirmed double spends.

func New

func New(cs modules.ConsensusSet, g modules.Gateway, persistDir string) (*TransactionPool, error)

New creates a transaction pool that is ready to receive transactions.

func (*TransactionPool) AcceptTransactionSet added in v1.0.0

func (tp *TransactionPool) AcceptTransactionSet(ts []types.Transaction) error

AcceptTransaction adds a transaction to the unconfirmed set of transactions. If the transaction is accepted, it will be relayed to connected peers.

TODO: Break into component sets when the set gets accepted.

func (*TransactionPool) Broadcast added in v1.3.0

func (tp *TransactionPool) Broadcast(ts []types.Transaction)

Broadcast broadcasts a transaction set to all of the transaction pool's peers.

func (*TransactionPool) Close added in v1.0.0

func (tp *TransactionPool) Close() error

Close releases any resources held by the transaction pool, stopping all of its worker threads.

func (*TransactionPool) FeeEstimation added in v1.0.0

func (tp *TransactionPool) FeeEstimation() (min, max types.Currency)

FeeEstimation returns an estimation for what fee should be applied to transactions.

func (*TransactionPool) ProcessConsensusChange added in v1.0.0

func (tp *TransactionPool) ProcessConsensusChange(cc modules.ConsensusChange)

ProcessConsensusChange gets called to inform the transaction pool of changes to the consensus set.

func (*TransactionPool) PurgeTransactionPool added in v0.3.1

func (tp *TransactionPool) PurgeTransactionPool()

PurgeTransactionPool deletes all transactions from the transaction pool.

func (*TransactionPool) Transaction added in v1.3.0

Transaction returns the transaction with the provided txid, its parents, and a bool indicating if it exists in the transaction pool.

func (*TransactionPool) TransactionList added in v1.0.0

func (tp *TransactionPool) TransactionList() []types.Transaction

TransactionList returns a list of all transactions in the transaction pool. The transactions are provided in an order that can acceptably be put into a block.

func (*TransactionPool) TransactionPoolSubscribe added in v0.3.1

func (tp *TransactionPool) TransactionPoolSubscribe(subscriber modules.TransactionPoolSubscriber)

TransactionPoolSubscribe adds a subscriber to the transaction pool. Subscribers will receive the full transaction set every time there is a significant change to the transaction pool.

func (*TransactionPool) Unsubscribe added in v1.0.0

func (tp *TransactionPool) Unsubscribe(subscriber modules.TransactionPoolSubscriber)

Unsubscribe removes a subscriber from the transaction pool. If the subscriber is not in tp.subscribers, Unsubscribe does nothing. If the subscriber occurs more than once in tp.subscribers, only the earliest occurrence is removed (unsubscription fails).

type TransactionSetID added in v1.0.0

type TransactionSetID crypto.Hash

Jump to

Keyboard shortcuts

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