Skip to content

Commit

Permalink
Regenerate nonce at least once every 60 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-andersen committed Mar 23, 2014
1 parent 166aa63 commit 732e6d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xptMiner/xptMiner/riecoinMiner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,16 @@ void riecoin_process(minerRiecoinBlock_t* block)
uint32 countPrimes = 0;

static const int maxiter = 100; /* XXX */
time_t start_time = time(NULL);
for (int loop = 0; loop < maxiter; loop++) {
__sync_synchronize(); /* gcc specific - memory barrier for checking height */
if( block->height != monitorCurrentBlockHeight ) {
break;
}
time_t cur_time = time(NULL);
if ((cur_time - start_time) > 60) {
break;
}

memset(sieve, 0, riecoin_sieveSize/8);

Expand Down

0 comments on commit 732e6d4

Please sign in to comment.