Documentation ¶
Index ¶
- type ObjectID
- type TransactionPool
- func (tp *TransactionPool) AcceptTransactionSet(ts []types.Transaction) error
- func (tp *TransactionPool) Close() error
- func (tp *TransactionPool) FeeEstimation() (min, max types.Currency)
- func (tp *TransactionPool) ProcessConsensusChange(cc modules.ConsensusChange)
- func (tp *TransactionPool) PurgeTransactionPool()
- func (tp *TransactionPool) Transaction(id types.TransactionID) (types.Transaction, error)
- func (tp *TransactionPool) TransactionList() []types.Transaction
- func (tp *TransactionPool) TransactionPoolSubscribe(subscriber modules.TransactionPoolSubscriber)
- func (tp *TransactionPool) Unsubscribe(subscriber modules.TransactionPoolSubscriber)
- func (tp *TransactionPool) ValidateTransactionSet(ts []types.Transaction) error
- type TransactionSetID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectID ¶
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, bcInfo types.BlockchainInfo, chainCts types.ChainConstants) (*TransactionPool, error)
New creates a transaction pool that is ready to receive transactions.
func (*TransactionPool) AcceptTransactionSet ¶
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) Close ¶
func (tp *TransactionPool) Close() error
func (*TransactionPool) FeeEstimation ¶
func (tp *TransactionPool) FeeEstimation() (min, max types.Currency)
FeeEstimation returns an estimation for what fee should be applied to transactions.
func (*TransactionPool) ProcessConsensusChange ¶
func (tp *TransactionPool) ProcessConsensusChange(cc modules.ConsensusChange)
ProcessConsensusChange gets called to inform the transaction pool of changes to the consensus set.
func (*TransactionPool) PurgeTransactionPool ¶
func (tp *TransactionPool) PurgeTransactionPool()
PurgeTransactionPool deletes all transactions from the transaction pool.
func (*TransactionPool) Transaction ¶ added in v1.0.7
func (tp *TransactionPool) Transaction(id types.TransactionID) (types.Transaction, error)
Transaction implements TransactionPool.Transaction
func (*TransactionPool) TransactionList ¶
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 ¶
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 ¶
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).
func (*TransactionPool) ValidateTransactionSet ¶ added in v1.0.7
func (tp *TransactionPool) ValidateTransactionSet(ts []types.Transaction) error
ValidateTransactionSet validates that all transacitons of a set follow the defined standards and are valid within its local context, knowing the height and timestamp of the last block. It also ensures that the transaction as well as the transaction set, are within an acceptable byte size range, when binary encoded.