transactionpool

package
v0.4.4-beta Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2015 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// The TransactionPoolSizeLimit is first checked, and then a transaction
	// set is added. The current transaction pool does not do any priority
	// ordering, so the size limit is such that the transaction pool will never
	// exceed the size of a block.
	//
	// TODO: Add a priority structure that will allow the transaction pool to
	// fill up beyond the size of a single block, without being subject to
	// manipulation.
	//
	// The first ~1/4 of the transaction pool can be filled for free. This is
	// mostly to preserve compatibility with clients that do not add fees.
	TransactionPoolSizeLimit  = 2e6 - 5e3 - modules.TransactionSetSizeLimit
	TransactionPoolSizeForFee = 500e3
)

Variables

View Source
var (
	TransactionMinFee = types.NewCurrency64(2).Mul(types.SiacoinPrecision)
)

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

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.

func (*TransactionPool) IsStandardTransaction

func (tp *TransactionPool) IsStandardTransaction(t types.Transaction) error

IsStandardTransaction enforces extra rules such as a transaction size limit. These rules can be altered without disrupting consensus.

func (*TransactionPool) IsStandardTransactionSet added in v1.0.0

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

IsStandardTransactionSet checks that all transacitons of a set follow the IsStandard guidelines, and that the set as a whole follows the guidelines as well.

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) RelayTransaction added in v0.3.1

func (tp *TransactionPool) RelayTransaction(conn modules.PeerConn) error

COMPAT v0.3.3.3

RelayTransactionSet is an RPC that accepts a transaction set from a peer. If the accept is successful, the transaction will be relayed to the gateway's other peers.

func (*TransactionPool) RelayTransactionSet

func (tp *TransactionPool) RelayTransactionSet(conn modules.PeerConn) error

RelayTransactionSet is an RPC that accepts a transaction set from a peer. If the accept is successful, the transaction will be relayed to the gateway's other peers.

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 signficant change to the transaction pool.

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