@@ -571,24 +571,22 @@ where
571571 Ok ( listener)
572572 }
573573
574- /// Adds all transactions in the iterator to the pool, each with its individual origin,
575- /// returning a list of results.
574+ /// Adds all transactions in the iterator to the pool, returning a list of results.
576575 ///
577576 /// Note: A large batch may lock the pool for a long time that blocks important operations
578577 /// like updating the pool on canonical state changes. The caller should consider having
579578 /// a max batch size to balance transaction insertions with other updates.
580- pub fn add_transactions_with_origins (
579+ pub fn add_transactions (
581580 & self ,
582- transactions : impl IntoIterator <
583- Item = ( TransactionOrigin , TransactionValidationOutcome < T :: Transaction > ) ,
584- > ,
581+ origin : TransactionOrigin ,
582+ transactions : impl IntoIterator < Item = TransactionValidationOutcome < T :: Transaction > > ,
585583 ) -> Vec < PoolResult < AddedTransactionOutcome > > {
586584 // Process all transactions in one write lock, maintaining individual origins
587585 let ( mut added, discarded) = {
588586 let mut pool = self . pool . write ( ) ;
589587 let added = transactions
590588 . into_iter ( )
591- . map ( |( origin , tx ) | self . add_transaction ( & mut pool, origin, tx) )
589+ . map ( |tx | self . add_transaction ( & mut pool, origin, tx) )
592590 . collect :: < Vec < _ > > ( ) ;
593591
594592 // Enforce the pool size limits if at least one transaction was added successfully
@@ -618,24 +616,11 @@ where
618616 * res = Err ( PoolError :: new ( * hash, PoolErrorKind :: DiscardedOnInsert ) )
619617 }
620618 }
621- }
619+ } ;
622620
623621 added
624622 }
625623
626- /// Adds all transactions in the iterator to the pool, returning a list of results.
627- ///
628- /// Note: A large batch may lock the pool for a long time that blocks important operations
629- /// like updating the pool on canonical state changes. The caller should consider having
630- /// a max batch size to balance transaction insertions with other updates.
631- pub fn add_transactions (
632- & self ,
633- origin : TransactionOrigin ,
634- transactions : impl IntoIterator < Item = TransactionValidationOutcome < T :: Transaction > > ,
635- ) -> Vec < PoolResult < AddedTransactionOutcome > > {
636- self . add_transactions_with_origins ( transactions. into_iter ( ) . map ( |tx| ( origin, tx) ) )
637- }
638-
639624 /// Notify all listeners about a new pending transaction.
640625 ///
641626 /// See also [`Self::add_pending_listener`]
0 commit comments