This commit is contained in:
jl777
2018-04-09 20:06:19 +03:00
parent dd5541420a
commit 8e9ef91cf4

View File

@@ -752,7 +752,7 @@ void static BitcoinMiner()
Mining_height = pindexPrev->nHeight+1; Mining_height = pindexPrev->nHeight+1;
Mining_start = (uint32_t)time(NULL); Mining_start = (uint32_t)time(NULL);
} }
if ( ASSETCHAINS_SYMBOL[0] != 0 ) if ( ASSETCHAINS_SYMBOL[0] != 0 && ASSETCHAINS_STAKED == 0 )
{ {
//fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height); //fprintf(stderr,"%s create new block ht.%d\n",ASSETCHAINS_SYMBOL,Mining_height);
sleep(3); sleep(3);
@@ -900,17 +900,26 @@ void static BitcoinMiner()
// fprintf(stderr," missed target\n"); // fprintf(stderr," missed target\n");
return false; return false;
} }
if ( /*ASSETCHAINS_SYMBOL[0] == 0 &&*/ Mining_start != 0 && time(NULL) < Mining_start+roundrobin_delay ) if ( ASSETCHAINS_STAKED == 0 )
{ {
//printf("Round robin diff sleep %d\n",(int32_t)(Mining_start+roundrobin_delay-time(NULL))); if ( Mining_start != 0 && time(NULL) < Mining_start+roundrobin_delay )
int32_t nseconds = Mining_start+roundrobin_delay-time(NULL); {
if ( nseconds > 0 ) //printf("Round robin diff sleep %d\n",(int32_t)(Mining_start+roundrobin_delay-time(NULL)));
sleep(nseconds); int32_t nseconds = Mining_start+roundrobin_delay-time(NULL);
MilliSleep((rand() % 1700) + 1); if ( nseconds > 0 )
sleep(nseconds);
MilliSleep((rand() % 1700) + 1);
}
else if ( ASSETCHAINS_SYMBOL[0] != 0 )
{
sleep(rand() % 30);
}
} }
else if ( ASSETCHAINS_SYMBOL[0] != 0 ) else
{ {
sleep(rand() % 30); printf("need to wait %d seconds to submit\n",(int32_t)(pblock->nTime - GetAdjustedTime()));
while ( GetAdjustedTime() < pblock->nTime )
sleep(1);
} }
KOMODO_CHOSEN_ONE = 1; KOMODO_CHOSEN_ONE = 1;
// Found a solution // Found a solution