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:
Varun Doshi
2025-03-19 22:49:04 +05:30
committed by GitHub
parent ffc4cceb07
commit d66e899526
2 changed files with 11 additions and 3 deletions

View File

@@ -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,

View File

@@ -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(),