File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
crates/transaction-pool/src/validate Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,16 @@ pub struct ValidationTask {
3434}
3535
3636impl ValidationTask {
37- /// Creates a new cloneable task pair
37+ /// Creates a new cloneable task pair.
38+ ///
39+ /// The sender sends new (transaction) validation tasks to an available validation task.
3840 pub fn new ( ) -> ( ValidationJobSender , Self ) {
39- let ( tx, rx) = mpsc:: channel ( 1 ) ;
41+ Self :: with_capacity ( 1 )
42+ }
43+
44+ /// Creates a new cloneable task pair with the given channel capacity.
45+ pub fn with_capacity ( capacity : usize ) -> ( ValidationJobSender , Self ) {
46+ let ( tx, rx) = mpsc:: channel ( capacity) ;
4047 let metrics = TxPoolValidatorMetrics :: default ( ) ;
4148 ( ValidationJobSender { tx, metrics } , Self :: with_receiver ( rx) )
4249 }
You can’t perform that action at this time.
0 commit comments