aboutsummaryrefslogtreecommitdiff
path: root/sha256_4way.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha256_4way.c')
-rw-r--r--sha256_4way.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sha256_4way.c b/sha256_4way.c
index 742682f..6d42451 100644
--- a/sha256_4way.c
+++ b/sha256_4way.c
@@ -100,7 +100,8 @@ static const unsigned int pSHA256InitState[8] =
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
-unsigned int ScanHash_4WaySSE2(const unsigned char *pmidstate, unsigned char *pdata,
+unsigned int ScanHash_4WaySSE2(int thr_id, const unsigned char *pmidstate,
+ unsigned char *pdata,
unsigned char *phash1, unsigned char *phash,
const unsigned char *ptarget,
uint32_t max_nonce, unsigned long *nHashesDone)
@@ -108,6 +109,8 @@ unsigned int ScanHash_4WaySSE2(const unsigned char *pmidstate, unsigned char *pd
unsigned int *nNonce_p = (unsigned int*)(pdata + 12);
unsigned int nonce = 0;
+ work_restart[thr_id].restart = 0;
+
for (;;)
{
unsigned int thash[9][NPAR] __attribute__((aligned(128)));
@@ -135,7 +138,7 @@ unsigned int ScanHash_4WaySSE2(const unsigned char *pmidstate, unsigned char *pd
}
}
- if (nonce >= max_nonce)
+ if ((nonce >= max_nonce) || work_restart[thr_id].restart)
{
*nHashesDone = nonce;
return -1;