diff --git a/crates/pool/src/mempool/uo_pool.rs b/crates/pool/src/mempool/uo_pool.rs index 0b8c224e0..bfa9fe20e 100644 --- a/crates/pool/src/mempool/uo_pool.rs +++ b/crates/pool/src/mempool/uo_pool.rs @@ -258,12 +258,15 @@ where }; // Add op to pool - let mut state = self.state.write(); - let hash = state.pool.add_operation(pool_op.clone())?; - let bn = state.block_number; - if throttled { - state.throttled_ops.insert(hash, bn); - } + let (hash, bn) = { + let mut state = self.state.write(); + let hash = state.pool.add_operation(pool_op.clone())?; + let bn = state.block_number; + if throttled { + state.throttled_ops.insert(hash, bn); + } + (hash, bn) + }; // Update reputation pool_op @@ -272,11 +275,6 @@ where .unique() .for_each(|a| self.reputation.add_seen(a)); - // If an entity was throttled, track with throttled ops - if throttled { - state.throttled_ops.insert(hash, bn); - } - let op_hash = pool_op.uo.op_hash(self.entry_point, self.chain_id); let valid_after = pool_op.valid_time_range.valid_after; let valid_until = pool_op.valid_time_range.valid_until;