Skip to content

Commit

Permalink
log
Browse files Browse the repository at this point in the history
  • Loading branch information
wjblanke committed Sep 24, 2024
1 parent 8b2fa4b commit 4ff5aab
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/prover_slow.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ form GenerateWesolowski(form &y, form &x_init,
return x;
}

void logit(char *sz)
{
FILE *f;
f = fopen("x.log", "a+");
if (f == NULL)
return;
fprintf(f, sz);
fprintf(f, "\n");
fclose(f);
}

std::vector<uint8_t> ProveSlow(integer& D, form& x, uint64_t num_iterations, std::string shutdown_file_path) {
integer L = root(-D, 4);
PulmarkReducer reducer;
Expand All @@ -105,8 +116,11 @@ std::vector<uint8_t> ProveSlow(integer& D, form& x, uint64_t num_iterations, std
// Check for cancellation every 65535 interations
if ((num_iterations&0xffff)==0) {
struct stat buffer;

char sz[200];
sprintf(sz,"num_iterations %d shutdown_file_path.c_str() %s",num_iterations,shutdown_file_path.c_str())
logit(sz)
if ((shutdown_file_path!="") && (stat (shutdown_file_path.c_str(), &buffer) != 0))
logit("aborting");
return {};
}
}
Expand Down

0 comments on commit 4ff5aab

Please sign in to comment.