Struct MempoolConfig

Source
pub struct MempoolConfig {
    pub version: MempoolVersion,
    pub recheck: bool,
    pub broadcast: bool,
    pub size: u64,
    pub max_txs_bytes: u64,
    pub cache_size: u64,
    pub keep_invalid_txs_in_cache: bool,
    pub max_tx_bytes: u64,
    pub ttl_duration: Duration,
    pub ttl_num_blocks: u64,
}

Fields§

§version: MempoolVersion

Mempool version

§recheck: bool

Recheck tx.

§broadcast: bool

Broadcast to other node’s mempool

§size: u64

Size of mempool

§max_txs_bytes: u64

Limit the total size of all txs in the mempool. This only accounts for raw transactions (e.g. given 1MB transactions and max_txs_bytes=5MB, mempool will only accept 5 transactions).

§cache_size: u64

Size of the cache (used to filter transactions we saw earlier) in transactions

§keep_invalid_txs_in_cache: bool

Do not remove invalid transactions from the cache (default: false) Set to true if it’s not possible for any invalid transaction to become valid again in the future.

§max_tx_bytes: u64

Maximum size of a single transaction. NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}.

§ttl_duration: Duration

ttl-duration, if non-zero, defines the maximum amount of time a transaction can exist for in the mempool.

Note, if ttl-num-blocks is also defined, a transaction will be removed if it has existed in the mempool at least ttl-num-blocks number of blocks or if it’s insertion time into the mempool is beyond ttl-duration.

§ttl_num_blocks: u64

ttl-num-blocks, if non-zero, defines the maximum number of blocks a transaction can exist for in the mempool.

Note, if ttl-duration is also defined, a transaction will be removed if it has existed in the mempool at least ttl-num-blocks number of blocks or if it’s insertion time into the mempool is beyond ttl-duration.

Implementations§

Source§

impl MempoolConfig

Source

pub fn version(self, version: MempoolVersion) -> Self

Source

pub fn recheck(self, recheck: bool) -> Self

Source

pub fn broadcast(self, broadcast: bool) -> Self

Source

pub fn size(self, size: u64) -> Self

Source

pub fn max_tx_bytes(self, max_tx_bytes: u64) -> Self

Source

pub fn cache_size(self, cache_size: u64) -> Self

Source

pub fn keep_invalid_txs_in_cache(self, keep_invalid_txs_in_cache: bool) -> Self

Source

pub fn ttl_duration(self, ttl_duration: Duration) -> Self

Source

pub fn ttl_num_blocks(self, ttl_num_blocks: u64) -> Self

Trait Implementations§

Source§

impl Clone for MempoolConfig

Source§

fn clone(&self) -> MempoolConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MempoolConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MempoolConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more