1
0
mirror of https://github.com/GOSTSec/gostoclminer synced 2025-01-30 08:24:29 +00:00

force getwork on return (stdin)

This commit is contained in:
tcatm 2011-02-05 13:59:06 +01:00
parent 342ebcc8ab
commit 9ad06ac9b9

24
miner.c
View File

@ -17,6 +17,7 @@
#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/select.h>
#include <pthread.h>
#include <getopt.h>
#include <jansson.h>
@ -510,8 +511,29 @@ int main (int argc, char *argv[])
fprintf(stderr, "%d miner threads started\n", i);
/* main loop */
struct timeval tv;
fd_set readfds;
int ret;
while (program_running) {
sleep(STAT_SLEEP_INTERVAL);
FD_ZERO(&readfds);
FD_SET(0, &readfds);
tv.tv_sec = STAT_SLEEP_INTERVAL;
tv.tv_usec = 0;
ret = select(1, &readfds, NULL, NULL, &tv);
if (ret) {
if (FD_ISSET(0, &readfds)) {
getchar();
printf("Forcing getwork\n");
block++;
}
}
double hashrate = 0;
char rates[128];
char buffer[16];