From 4f7cee40933e676493e74bfbfe4843c3e3bffe3e Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 12 Jan 2024 11:12:25 +1000 Subject: [PATCH] equihash: Clear slots when setting the hash state The equivalent change is made to the C worker, which is unused. --- components/equihash/tromp/equi_miner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/equihash/tromp/equi_miner.c b/components/equihash/tromp/equi_miner.c index 6948876df..c86d76755 100644 --- a/components/equihash/tromp/equi_miner.c +++ b/components/equihash/tromp/equi_miner.c @@ -299,6 +299,7 @@ typedef struct equi equi; eq->blake_ctx = eq->blake2b_clone(ctx); memset(eq->nslots, 0, NBUCKETS * sizeof(au32)); // only nslots[0] needs zeroing + equi_clearslots(eq); eq->nsols = 0; } void equi_clearslots(equi *eq) { @@ -694,6 +695,9 @@ void *worker(void *vp) { // if (tp->id == 0) // printf("Digit 0\n"); + if (tp->id == 0) { + equi_clearslots(eq); + } equi_digit0(eq, tp->id); if (tp->id == 0) { equi_clearslots(eq);