mochimodev/winminer

Winminer 1.4.1 blocks not updateing

Closed this issue · 2 comments

New mochimo headless miner winminer 1.41 has a problem with updating blocks. Sometimes it updates a block after >45 seconds and sometimes it updates after 5+ minutes or sometimes it completely skips a block. Manual miner restart fixes probem and miner downloads correct block only for the problem to persist again...

image

Thanks @Opsjenar. Looks like it might be a bug with the update-monitor resetting it's firstupdate variable every second block or so once it's detected a block update.

set_bnum(Cblocknum, ip);
if (cmp64(Cblocknum, LastCblocknum) > 0) {
if (firstupdate != 0) {
memcpy(LastCblocknum, Cblocknum, 8);
firstupdate = 0;
continue;
}
printf("\nBlock update detected.");
memcpy(LastCblocknum, Cblocknum, 8);
if (cmp64(Cblocknum, LastCblocknum) != 0) printf("\nmemcpy failed.");
restartlock = fopen("restart.tmp", "w+b");
if (restartlock == NULL) {
printf("\nCouldn't open restart lock file.");
} else {
fwrite(LastCblocknum, 8, 1, restartlock);
}
fclose(restartlock);
system("copy restart.tmp restart.lck");
_unlink("restart.tmp");
// Prepare for next run.
Sleep(100);
firstupdate = 1;
}

I'll fix it up and run some tests before sending out a new binary.

The v1.4.2 release e8b5e14 fixes this.
Thanks for raising the issue.
Closing