Skip to main content

mine_salt

Function mine_salt 

Source
pub(crate) fn mine_salt<T, F>(
    salt: B256,
    n_threads: usize,
    check: F,
) -> Option<T>
where T: Send + 'static, F: FnMut(B256) -> Option<T> + Clone + Send + 'static,
Expand description

Mines a salt by iterating B256 values in parallel until check returns Some.

Each of the n_threads threads starts at salt + thread_index and steps by n_threads, ensuring non-overlapping coverage. Returns None only if all threads panicked.