iotex-core: Index | Files | Directories

package actpool

import ""


Package Files

actpool.go actqueue.go options.go

func WithClock Uses

func WithClock(c clock.Clock) interface{ ActQueueOption }

WithClock returns an option to overwrite clock.

func WithTimeOut Uses

func WithTimeOut(ttl time.Duration) interface{ ActQueueOption }

WithTimeOut returns an option to overwrite time out setting.

type ActPool Uses

type ActPool interface {
    // Reset resets actpool state
    // PendingActionMap returns an action map with all accepted actions
    PendingActionMap() map[string][]action.SealedEnvelope
    // Add adds an action into the pool after passing validation
    Add(ctx context.Context, act action.SealedEnvelope) error
    // GetPendingNonce returns pending nonce in pool given an account address
    GetPendingNonce(addr string) (uint64, error)
    // GetUnconfirmedActs returns unconfirmed actions in pool given an account address
    GetUnconfirmedActs(addr string) []action.SealedEnvelope
    // GetActionByHash returns the pending action in pool given action's hash
    GetActionByHash(hash hash.Hash256) (action.SealedEnvelope, error)
    // GetSize returns the act pool size
    GetSize() uint64
    // GetCapacity returns the act pool capacity
    GetCapacity() uint64
    // GetGasSize returns the act pool gas size
    GetGasSize() uint64
    // GetGasCapacity returns the act pool gas capacity
    GetGasCapacity() uint64


ActPool is the interface of actpool

func NewActPool Uses

func NewActPool(sf protocol.StateReader, cfg config.ActPool, opts ...Option) (ActPool, error)

NewActPool constructs a new actpool

type ActQueue Uses

type ActQueue interface {
    Overlaps(action.SealedEnvelope) bool
    Put(action.SealedEnvelope) error
    FilterNonce(uint64) []action.SealedEnvelope
    UpdateQueue(uint64) []action.SealedEnvelope
    PendingNonce() uint64
    PendingBalance() *big.Int
    Len() int
    Empty() bool
    PendingActs() []action.SealedEnvelope
    AllActs() []action.SealedEnvelope

ActQueue is the interface of actQueue

func NewActQueue Uses

func NewActQueue(ap *actPool, address string, ops ...ActQueueOption) ActQueue

NewActQueue create a new action queue

type ActQueueOption Uses

type ActQueueOption interface {

ActQueueOption is the option for actQueue.

type Option Uses

type Option func(pool *actPool) error

Option sets action pool construction parameter

func EnableExperimentalActions Uses

func EnableExperimentalActions() Option

EnableExperimentalActions enables the action pool to take experimental actions

type SortedActions Uses

type SortedActions []action.SealedEnvelope

SortedActions is a slice of actions that implements sort.Interface to sort by Value.

func (SortedActions) Len Uses

func (p SortedActions) Len() int

func (SortedActions) Less Uses

func (p SortedActions) Less(i, j int) bool

func (SortedActions) Swap Uses

func (p SortedActions) Swap(i, j int)



Package actpool imports 19 packages (graph) and is imported by 5 packages. Updated 2020-03-29. Refresh now. Tools for package owners.