Skip to content

Commit

Permalink
equihash: Clear slots when setting the hash state
Browse files Browse the repository at this point in the history
The equivalent change is made to the C worker, which is unused.
  • Loading branch information
teor2345 authored and str4d committed Apr 18, 2024
1 parent d2907df commit 4f7cee4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/equihash/tromp/equi_miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 4f7cee4

Please sign in to comment.