1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-23 04:54:26 +00:00

Return error if BFL take longer then 10s

This commit is contained in:
Paul Sheppard 2012-05-18 17:41:18 -07:00
parent 407be57400
commit 4db47aa57a

View File

@ -329,7 +329,7 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
usleep(4500000);
i = 4500;
while (1) {
while (i < 10000) {
BFwrite(fdDev, "ZFX", 3);
BFgets(pdevbuf, sizeof(pdevbuf), fdDev);
if (unlikely(!pdevbuf[0])) {
@ -341,6 +341,12 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
usleep(10000);
i += 10;
}
if (i >= 10000) {
applog(LOG_DEBUG, "BitForce took longer than 10s");
return 0;
}
applog(LOG_DEBUG, "BitForce waited %dms until %s\n", i, pdevbuf);
work->blk.nonce = 0xffffffff;
if (pdevbuf[2] == '-')