@Epsylon3 .. @pallas........Or Anybody else, please help me .........
I wanted to add share info into a file (only for the submitted shares)......... Currently i succeeded to write the share diff only into a file.
How can we add....... blockheader info too.... or their individual parts, ....
sctx->xnonce1, sctx->xnonce2, merkle_root, work->nonces, sctx->job.coinbase, sctx->job.ntime, sctx->job.prevhash...... into the output file...
//===Util.cpp=======================================
void filelog(FILE *file1, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
char *f; const time_t now = time(NULL);
struct tm tm;
localtime_r(&now, &tm);
f = (char*)alloca(40 + (int)strlen(fmt) + 2);
sprintf(f, "[%d-%02d-%02d %02d:%02d:%02d]%s %s%s\n",
tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec,
"", fmt, ""
);
vfprintf(file1, f, ap); /* write to file */
va_end(ap);
}
//======ccminer.cpp===================================
filelog(file1, "accepted: %lu/%lu (%s)",
p->accepted_count, p->accepted_count + p->rejected_count, suppl);
fflush(file1);