Documentation
¶
Index ¶
- Constants
- func IsBadTx(err error) bool
- func IsTxRejected(err error) bool
- type Options
- type TxEvent
- type TxObject
- type TxPool
- func (p *TxPool) Add(newTx *tx.Transaction) error
- func (p *TxPool) AddLocal(newTx *tx.Transaction) error
- func (p *TxPool) Close()
- func (p *TxPool) Dump() tx.Transactions
- func (p *TxPool) Executables() tx.Transactions
- func (p *TxPool) Fill(txs tx.Transactions)
- func (p *TxPool) Get(id thor.Bytes32) *tx.Transaction
- func (p *TxPool) Len() int
- func (p *TxPool) Remove(txHash thor.Bytes32, txID thor.Bytes32) bool
- func (p *TxPool) StrictlyAdd(newTx *tx.Transaction) error
- func (p *TxPool) SubscribeTxEvent(ch chan *TxEvent) event.Subscription
Constants ¶
View Source
const (
// max size of tx allowed
MaxTxSize = 64 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func IsTxRejected ¶
IsTxRejected returns whether the given error indicates tx is rejected.
Types ¶
type Options ¶
type Options struct {
Limit int
LimitPerAccount int
MaxLifetime time.Duration
BlocklistCacheFilePath string
BlocklistFetchURL string
}
Options options for tx pool.
type TxEvent ¶
type TxEvent struct {
Tx *tx.Transaction
Executable *bool
}
TxEvent will be posted when tx is added or status changed.
type TxObject ¶ added in v2.4.0
type TxObject struct {
*tx.Transaction
// contains filtered or unexported fields
}
func ResolveTx ¶ added in v2.4.0
func ResolveTx(tx *tx.Transaction, localSubmitted bool) (*TxObject, error)
func (*TxObject) Executable ¶ added in v2.4.0
type TxPool ¶
type TxPool struct {
// contains filtered or unexported fields
}
TxPool maintains unprocessed transactions.
func New ¶
func New(repo *chain.Repository, stater *state.Stater, options Options, forkConfig *thor.ForkConfig) *TxPool
New create a new TxPool instance. Shutdown is required to be called at end.
func (*TxPool) Add ¶
func (p *TxPool) Add(newTx *tx.Transaction) error
Add adds a new tx into pool. It's not assumed as an error if the tx to be added is already in the pool,
func (*TxPool) AddLocal ¶
func (p *TxPool) AddLocal(newTx *tx.Transaction) error
AddLocal adds new locally submitted tx into pool.
func (*TxPool) Executables ¶
func (p *TxPool) Executables() tx.Transactions
Executables returns executable txs.
func (*TxPool) StrictlyAdd ¶
func (p *TxPool) StrictlyAdd(newTx *tx.Transaction) error
StrictlyAdd add new tx into pool. A rejection error will be returned, if tx is not executable at this time.
func (*TxPool) SubscribeTxEvent ¶
func (p *TxPool) SubscribeTxEvent(ch chan *TxEvent) event.Subscription
SubscribeTxEvent receivers will receive a tx
Click to show internal directories.
Click to hide internal directories.