|
1 |
| -//! `RandomX` VM Cache |
| 1 | +//! RandomX VM Cache |
2 | 2 | //!
|
3 |
| -//! This module keeps track of the `RandomX` VM to calculate the next blocks proof-of-work, if the block needs a randomX VM and potentially |
| 3 | +//! This module keeps track of the RandomX VM to calculate the next blocks proof-of-work, if the block needs a randomX VM and potentially |
4 | 4 | //! more VMs around this height.
|
5 | 5 | //!
|
6 | 6 | use std::{
|
@@ -34,11 +34,11 @@ pub const RX_SEEDS_CACHED: usize = 2;
|
34 | 34 | /// A multithreaded randomX VM.
|
35 | 35 | #[derive(Debug)]
|
36 | 36 | pub struct RandomXVm {
|
37 |
| - /// These `RandomX` VMs all share the same cache. |
| 37 | + /// These RandomX VMs all share the same cache. |
38 | 38 | vms: ThreadLocal<VmInner>,
|
39 |
| - /// The `RandomX` cache. |
| 39 | + /// The RandomX cache. |
40 | 40 | cache: RandomXCache,
|
41 |
| - /// The flags used to start the `RandomX` VMs. |
| 41 | + /// The flags used to start the RandomX VMs. |
42 | 42 | flags: RandomXFlag,
|
43 | 43 | }
|
44 | 44 |
|
@@ -161,7 +161,7 @@ impl RandomXVmCache {
|
161 | 161 | Ok(alt_vm)
|
162 | 162 | }
|
163 | 163 |
|
164 |
| - /// Get the main-chain `RandomX` VMs. |
| 164 | + /// Get the main-chain RandomX VMs. |
165 | 165 | pub async fn get_vms(&mut self) -> HashMap<usize, Arc<RandomXVm>> {
|
166 | 166 | match self.seeds.len().checked_sub(self.vms.len()) {
|
167 | 167 | // No difference in the amount of seeds to VMs.
|
@@ -213,7 +213,7 @@ impl RandomXVmCache {
|
213 | 213 | self.vms.clone()
|
214 | 214 | }
|
215 | 215 |
|
216 |
| - /// Removes all the `RandomX` VMs above the `new_height`. |
| 216 | + /// Removes all the RandomX VMs above the `new_height`. |
217 | 217 | pub fn pop_blocks_main_chain(&mut self, new_height: usize) {
|
218 | 218 | self.seeds.retain(|(height, _)| *height < new_height);
|
219 | 219 | self.vms.retain(|height, _| *height < new_height);
|
|
0 commit comments