Skip to content

Commit

Permalink
Merge pull request #7 from chrisdigity/feature/intrablock_update
Browse files Browse the repository at this point in the history
Fix block update issue and improvements
  • Loading branch information
chrisdigity authored Apr 22, 2019
2 parents 718830d + 2c7c185 commit e8b5e14
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions binaries/_README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MD5HASH for these executables are:

mochimo-winminer.exe 0C597243E88E193983D59B6A112DDA81
update-monitor.exe B428A2022DCB322CADA1713DB72536ED
mochimo-winminer.exe 57334C8788E9940F306BCF8CD285206D
update-monitor.exe 4F18E7CDF633341EF7C55952014D514B

This software is offered with no warranty, and is subject to the terms and conditions of the license, which can be found here:
https://github.com/mochimodev/mochimo/blob/master/LICENSE.PDF
Expand Down
Binary file modified binaries/mochimo-winminer.exe
Binary file not shown.
Binary file modified binaries/update-monitor.exe
Binary file not shown.
20 changes: 15 additions & 5 deletions winminer_v1/updatemonitor/updatemonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ int main(int argc, char **argv)
int j, status;
time_t stime;
time_t now = time(NULL);
time_t interval = 40;
time_t update = now + interval;
char *Statusarg;
word32 *ip;
int firstupdate = 1;
int intervalmultiplier = 1;
FILE *restartlock;

static WORD wsaVerReq;
Expand All @@ -60,13 +63,20 @@ int main(int argc, char **argv)
ip = &Coreplist[j];
if (*ip == 0) continue;
set_bnum(Cblocknum, ip);
if (cmp64(Cblocknum, LastCblocknum) > 0) {
now = time(NULL);
if (cmp64(Cblocknum, LastCblocknum) > 0 || now >= update) {
if (firstupdate != 0) {
memcpy(LastCblocknum, Cblocknum, 8);
firstupdate = 0;
continue;
}
printf("\nBlock update detected.");
if(now >= update) {
intervalmultiplier *= 2;
printf("\nIntra-Block update.");
} else {
intervalmultiplier = 1;
printf("\nBlock update detected.");
}
memcpy(LastCblocknum, Cblocknum, 8);
if (cmp64(Cblocknum, LastCblocknum) != 0) printf("\nmemcpy failed.");
restartlock = fopen("restart.tmp", "w+b");
Expand All @@ -78,10 +88,10 @@ int main(int argc, char **argv)
fclose(restartlock);
system("copy restart.tmp restart.lck");
_unlink("restart.tmp");

// Prepare for next run.

// Prepare for next run.
update = now + (interval * intervalmultiplier);
Sleep(100);
firstupdate = 1;
}
}
if (Needcleanup) WSACleanup();
Expand Down
2 changes: 1 addition & 1 deletion winminer_v1/winminer/winminer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ int main(int argc, char **argv)
srand16(time(&stime));
srand2(stime, 0, 0);

printf("\nMochimo Windows Headless Miner version 1.4.1\n"
printf("\nMochimo Windows Headless Miner version 1.4.2\n"
"Mochimo Main Net v2.3 Original Release Date: 04/07/2019\n"
"Copyright (c) 2019 by Adequate Systems, LLC."
" All Rights Reserved.\n\n"
Expand Down

0 comments on commit e8b5e14

Please sign in to comment.