mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-10 07:48:19 -05:00
feat: use configured max_new_pending_txs_notifications channel for channel size (#15132)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -53,9 +53,14 @@ pub struct PendingPool<T: TransactionOrdering> {
|
||||
// === impl PendingPool ===
|
||||
|
||||
impl<T: TransactionOrdering> PendingPool<T> {
|
||||
/// Create a new pool instance.
|
||||
/// Create a new pending pool instance.
|
||||
pub fn new(ordering: T) -> Self {
|
||||
let (new_transaction_notifier, _) = broadcast::channel(200);
|
||||
Self::with_buffer(ordering, 200)
|
||||
}
|
||||
|
||||
/// Create a new pool instance with the given buffer capacity.
|
||||
pub fn with_buffer(ordering: T, buffer_capacity: usize) -> Self {
|
||||
let (new_transaction_notifier, _) = broadcast::channel(buffer_capacity);
|
||||
Self {
|
||||
ordering,
|
||||
submission_id: 0,
|
||||
|
||||
@@ -124,7 +124,10 @@ impl<T: TransactionOrdering> TxPool<T> {
|
||||
pub fn new(ordering: T, config: PoolConfig) -> Self {
|
||||
Self {
|
||||
sender_info: Default::default(),
|
||||
pending_pool: PendingPool::new(ordering),
|
||||
pending_pool: PendingPool::with_buffer(
|
||||
ordering,
|
||||
config.max_new_pending_txs_notifications,
|
||||
),
|
||||
queued_pool: Default::default(),
|
||||
basefee_pool: Default::default(),
|
||||
blob_pool: Default::default(),
|
||||
|
||||
Reference in New Issue
Block a user