transactionpool

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrefixNonSia         = "NonSia"
	TransactionSizeLimit = 16 * 1024
)

Variables

View Source
var (
	ErrBadUnlockConditions      = errors.New("siacoin unlock conditions do not meet required unlock hash")
	ErrSiacoinOverspend         = errors.New("transaction has more siacoin outputs than inputs")
	ErrUnrecognizedSiacoinInput = errors.New("unrecognized siacoin input in transaction")
)

Functions

This section is empty.

Types

type TransactionPool

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

The transaction pool keeps an unconfirmed set of transactions along with the contracts and outputs that have been created by unconfirmed transactions. Incoming transactions are allowed to use objects in the unconfirmed consensus set. Doing so will consume them, preventing other transactions from using them.

func New

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

func (*TransactionPool) AcceptTransaction

func (tp *TransactionPool) AcceptTransaction(t types.Transaction) (err 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) (err error)

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

func (*TransactionPool) PurgeTransactionPool added in v0.3.1

func (tp *TransactionPool) PurgeTransactionPool()

PurgeTransactionPool deletes all transactions from the transaction pool. It's a failsafe for when the transaction pool is producing invalid transaction sets.

func (*TransactionPool) ReceiveConsensusSetUpdate added in v0.3.1

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

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

func (*TransactionPool) RelayTransaction added in v0.3.1

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

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

func (*TransactionPool) TransactionPoolNotify added in v0.3.1

func (tp *TransactionPool) TransactionPoolNotify() <-chan struct{}

TransactionPoolNotify adds a subscriber to the list who will be notified any time that there is a change to the transaction pool (new transaction or block), but that subscriber will not be told any details about the change.

func (*TransactionPool) TransactionPoolSubscribe added in v0.3.1

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

TransactionPoolSubscribe adds a subscriber to the transaction pool that will be given a full list of changes via ReceiveTransactionPoolUpdate any time that there is a change.

func (*TransactionPool) TransactionSet

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

TransactionSet returns the set of unconfirmed transactions in the order they are required to appear in a block. This function will not limit the volume of transactions to fit in a single block.

Jump to

Keyboard shortcuts

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