File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
crates/transaction-pool/src Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 6565 ( processor, request_tx)
6666 }
6767
68+ async fn process_request ( pool : & Pool , req : BatchTxRequest < Pool :: Transaction > ) {
69+ let BatchTxRequest { pool_tx, response_tx } = req;
70+ let pool_result = pool. add_transaction ( TransactionOrigin :: Local , pool_tx) . await ;
71+ let _ = response_tx. send ( pool_result) ;
72+ }
73+
6874 /// Process a batch of transaction requests, grouped by origin
69- async fn process_batch ( pool : & Pool , batch : Vec < BatchTxRequest < Pool :: Transaction > > ) {
75+ async fn process_batch ( pool : & Pool , mut batch : Vec < BatchTxRequest < Pool :: Transaction > > ) {
76+ if batch. len ( ) == 1 {
77+ Self :: process_request ( pool, batch. remove ( 0 ) ) . await ;
78+ return
79+ }
80+
7081 let ( pool_transactions, response_tx) : ( Vec < _ > , Vec < _ > ) =
7182 batch. into_iter ( ) . map ( |req| ( req. pool_tx , req. response_tx ) ) . unzip ( ) ;
7283
You can’t perform that action at this time.
0 commit comments