pub enum TxPoolMpsc {
    PendingNumber {
        response: Sender<usize>,
    },
    ConsumableGas {
        response: Sender<u64>,
    },
    Includable {
        response: Sender<Vec<ArcPoolTx>>,
    },
    Insert {
        txs: Vec<Arc<Transaction>>,
        response: Sender<Vec<Result<InsertionResult>>>,
    },
    Find {
        ids: Vec<TxId>,
        response: Sender<Vec<Option<TxInfo>>>,
    },
    FindOne {
        id: TxId,
        response: Sender<Option<TxInfo>>,
    },
    FindDependent {
        ids: Vec<TxId>,
        response: Sender<Vec<ArcPoolTx>>,
    },
    Remove {
        ids: Vec<TxId>,
        response: Sender<Vec<ArcPoolTx>>,
    },
    FilterByNegative {
        ids: Vec<TxId>,
        response: Sender<Vec<TxId>>,
    },
    Stop,
}
Expand description

RPC commands that can be sent to the TxPool through an MPSC channel. Responses are returned using response oneshot channel.

Variants§

§

PendingNumber

Fields

§response: Sender<usize>

The number of pending transactions in the pool.

§

ConsumableGas

Fields

§response: Sender<u64>

The amount of gas in all includable transactions combined

§

Includable

Fields

§response: Sender<Vec<ArcPoolTx>>

Return all sorted transactions that are includable in next block. This is going to be heavy operation, use it only when needed.

§

Insert

Fields

§txs: Vec<Arc<Transaction>>

import list of transaction into txpool. All needed parents need to be known and parent->child order should be enforced in Vec, we will not do that check inside txpool and will just drop child and include only parent. Additional restrain is that child gas_price needs to be lower then parent gas_price. Transaction can be received from p2p RespondTransactions or from userland. Because of userland we are returning error for every insert for better user experience.

§

Find

Fields

§ids: Vec<TxId>
§response: Sender<Vec<Option<TxInfo>>>

find all tx by their hash

§

FindOne

Fields

§id: TxId
§response: Sender<Option<TxInfo>>

find one tx by its hash

§

FindDependent

Fields

§ids: Vec<TxId>
§response: Sender<Vec<ArcPoolTx>>

find all dependent tx and return them with requested dependencies in one list sorted by Price.

§

Remove

Fields

§ids: Vec<TxId>
§response: Sender<Vec<ArcPoolTx>>

remove transaction from pool needed on user demand. Low priority

§

FilterByNegative

Fields

§ids: Vec<TxId>
§response: Sender<Vec<TxId>>

Iterate over hashes and return all hashes that we don’t have. Needed when we receive list of new hashed from peer with BroadcastTransactionHashes, so txpool needs to return tx that we don’t have, and request them from that particular peer.

§

Stop

stop txpool

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more