Documentation ¶
Index ¶
- Constants
- Variables
- type TransactionPool
- func (tp *TransactionPool) AcceptTransaction(t types.Transaction) (err error)
- func (tp *TransactionPool) IsStandardTransaction(t types.Transaction) (err error)
- func (tp *TransactionPool) PurgeTransactionPool()
- func (tp *TransactionPool) ReceiveConsensusSetUpdate(revertedBlocks, appliedBlocks []types.Block)
- func (tp *TransactionPool) RelayTransaction(conn modules.PeerConn) error
- func (tp *TransactionPool) TransactionPoolNotify() <-chan struct{}
- func (tp *TransactionPool) TransactionPoolSubscribe(subscriber modules.TransactionPoolSubscriber)
- func (tp *TransactionPool) TransactionSet() []types.Transaction
Constants ¶
const ( PrefixNonSia = "NonSia" TransactionSizeLimit = 16 * 1024 )
Variables ¶
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") )
var (
ErrDuplicate = errors.New("transaction is a duplicate")
)
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 (*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()
func (*TransactionPool) ReceiveConsensusSetUpdate ¶ added in v0.3.1
func (tp *TransactionPool) ReceiveConsensusSetUpdate(revertedBlocks, appliedBlocks []types.Block)
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.