mirror of
https://github.com/TransparentLC/opencl_vanity_gpg.git
synced 2026-01-29 09:06:59 +00:00
fix: break instead of wrap in max_time_range mode
This commit is contained in:
parent
cde0d2ba61
commit
55bc233c41
2 changed files with 7 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ use std::{
|
|||
sync::{mpsc::*, LazyLock},
|
||||
thread,
|
||||
time::Instant,
|
||||
usize,
|
||||
};
|
||||
use utils::ARGS;
|
||||
use utils::*;
|
||||
|
|
@ -167,7 +168,10 @@ fn main() -> anyhow::Result<()> {
|
|||
|
||||
thread::spawn(move || opencl_thread(buffer_result, pro_que, rx_hashdata, tx_result));
|
||||
|
||||
let bench_size = (dimension * iteration) as u64;
|
||||
let bench_size = std::cmp::min(
|
||||
(dimension * iteration) as u64,
|
||||
ARGS.max_time_range.map(|x| x as u64).unwrap_or(u64::MAX),
|
||||
);
|
||||
let bar = bars.add(init_progress_bar(estimate));
|
||||
|
||||
loop {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ __kernel void vanity_sha1(__constant uint *hashdata, __global uint *result, cons
|
|||
// Each thread gets a small sequential offset
|
||||
uint offset = thread_id + i * get_global_size(0);
|
||||
|
||||
// Wrap around within max_time_range to avoid going too far
|
||||
if (max_time_range) offset %= max_time_range;
|
||||
// Avoid going too far (within max_time_range)
|
||||
if (max_time_range && offset > max_time_range) break;
|
||||
|
||||
if (FUTURE_MODE) {
|
||||
// For future mode: increment timestamp within range
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue