Move creating ongoing ops
@@ -258,9 +258,6 @@ impl<DB: DatabaseInterface> ETHSender<DB> {
}
};
- // Queue for storing all the operations that were not finished at this iteration.
- let mut new_ongoing_ops = VecDeque::new();
-
while let Some(tx) = self.tx_queue.pop_front() {
if let Err(e) = self.initialize_operation(tx.clone(), current_block).await {
Self::process_error(e).await;
@@ -281,6 +278,9 @@ impl<DB: DatabaseInterface> ETHSender<DB> {
// states because it would be spare requests.
// The ongoing operations list would be the same for the next step
if last_used_block != current_block {
+ // Queue for storing all the operations that were not finished at this iteration.
+ let mut new_ongoing_ops = VecDeque::new();
+
// Commit the next operations (if any).
while let Some(mut current_op) = self.ongoing_ops.pop_front() {
// We perform a commitment step here. In case of error, we suppose that this is some
