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
impl MempoolConfig
pub fn version(self, version: MempoolVersion) -> Self
pub fn recheck(self, recheck: bool) -> Self
pub fn broadcast(self, broadcast: bool) -> Self
pub fn size(self, size: u64) -> Self
pub fn max_tx_bytes(self, max_tx_bytes: u64) -> Self
pub fn cache_size(self, cache_size: u64) -> Self
pub fn keep_invalid_txs_in_cache(self, keep_invalid_txs_in_cache: bool) -> Self
pub fn ttl_duration(self, ttl_duration: Duration) -> Self
pub fn ttl_num_blocks(self, ttl_num_blocks: u64) -> Self
Trait Implementations§
Source§impl Clone for MempoolConfig
impl Clone for MempoolConfig
Source§fn clone(&self) -> MempoolConfig
fn clone(&self) -> MempoolConfig
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more