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 19, 2024
1 parent 3ac3b05 commit ef41c12
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 @@ -301,6 +301,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 @@ -698,6 +699,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 ef41c12

Please sign in to comment.