File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,11 +137,19 @@ func (t *BatchTxPool) Add(
137137 // transactions that might come from the same EOA.
138138 // [X] is equal to the configured `TxBatchInterval` duration.
139139 lastActivityTime , found := t .eoaActivity .Get (from )
140- if ! found || time .Since (lastActivityTime ) > t .config .TxBatchInterval {
140+
141+ if ! found {
142+ // Case 1. EOA activity not found:
143+ if err := t .submitSingleTransaction (ctx , hexEncodedTx ); err != nil {
144+ return err
145+ }
146+ } else if time .Since (lastActivityTime ) > t .config .TxBatchInterval {
147+ // Case 2. EOA activity found AND it was more than [X] seconds ago:
141148 if err := t .submitSingleTransaction (ctx , hexEncodedTx ); err != nil {
142149 return err
143150 }
144151 } else {
152+ // Case 3. EOA activity found AND it was less than [X] seconds ago:
145153 userTx := pooledEvmTx {txPayload : hexEncodedTx , nonce : tx .Nonce ()}
146154 t .pooledTxs [from ] = append (t .pooledTxs [from ], userTx )
147155 }
You can’t perform that action at this time.
0 commit comments