diff --git a/crates/transaction-pool/src/pool/pending.rs b/crates/transaction-pool/src/pool/pending.rs index b24368996c..295c546fb5 100644 --- a/crates/transaction-pool/src/pool/pending.rs +++ b/crates/transaction-pool/src/pool/pending.rs @@ -53,9 +53,14 @@ pub struct PendingPool { // === impl PendingPool === impl PendingPool { - /// 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, diff --git a/crates/transaction-pool/src/pool/txpool.rs b/crates/transaction-pool/src/pool/txpool.rs index c762d65cb8..c9a1854bf7 100644 --- a/crates/transaction-pool/src/pool/txpool.rs +++ b/crates/transaction-pool/src/pool/txpool.rs @@ -124,7 +124,10 @@ impl TxPool { 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(),