|
|
@ -1167,9 +1167,10 @@ void static RandomXMiner() |
|
|
|
gotinvalid = 0; |
|
|
|
while (true) |
|
|
|
{ |
|
|
|
fprintf(stderr,"RandomXMiner: gotinvalid=%d\n",gotinvalid); |
|
|
|
if ( gotinvalid != 0 ) |
|
|
|
if ( gotinvalid != 0 ) { |
|
|
|
fprintf(stderr,"RandomXMiner: gotinvalid=%d\n",gotinvalid); |
|
|
|
break; |
|
|
|
} |
|
|
|
hush_longestchain(); |
|
|
|
|
|
|
|
fprintf(stderr,"RandomXMiner: solving with nNonce = %s\n",pblock->nNonce.ToString().c_str()); |
|
|
@ -1177,16 +1178,16 @@ void static RandomXMiner() |
|
|
|
hashTarget = HASHTarget; |
|
|
|
|
|
|
|
char randomxHash[RANDOMX_HASH_SIZE]; |
|
|
|
fprintf(stderr,"RandomXMiner: created randomxHash of size %d\n", RANDOMX_HASH_SIZE); |
|
|
|
// Initial randomx key is ac_name which is >= 2^40 bits of entropy assuming strlen(ac_name) >= 5
|
|
|
|
// For ac_name=DRAGONX we have 7 bytes or 2^56 bits of entropy
|
|
|
|
char randomxKey[65]; // randomx spec says keysize of >60 bytes is implementation-specific
|
|
|
|
strncpy(randomxKey, SMART_CHAIN_SYMBOL, 65); |
|
|
|
//fprintf(stderr,"RandomXMiner: created randomxHash of size %d\n", RANDOMX_HASH_SIZE);
|
|
|
|
char randomxKey[82]; // randomx spec says keysize of >60 bytes is implementation-specific
|
|
|
|
// initial randomx key is unique to every Hush Smart Chain, and has at least 9 bytes (2^128 bits) of entropy
|
|
|
|
// since magic is 4 bytes, rpc port is 4 bytes and smart chain symbol must be at least 1 character long
|
|
|
|
snprintf(randomxKey, 81, "%08x%s%08x", ASSETCHAINS_MAGIC, SMART_CHAIN_SYMBOL, ASSETCHAINS_RPCPORT); |
|
|
|
|
|
|
|
char randomxInput[80]; |
|
|
|
sprintf(randomxInput, "%08x Extreme Privacy Hush Smart Chain %08x", ASSETCHAINS_MAGIC, ASSETCHAINS_MAGIC); |
|
|
|
|
|
|
|
fprintf(stderr,"RandomXMiner: created randomxInput=%s\n", randomxInput); |
|
|
|
fprintf(stderr,"RandomXMiner: created randomxKey=%s , randomxInput=%s\n", randomxKey, randomxInput); |
|
|
|
|
|
|
|
randomx_flags flags = randomx_get_flags(); |
|
|
|
randomx_cache *randomxCache = randomx_alloc_cache(flags); |
|
|
@ -1194,7 +1195,7 @@ void static RandomXMiner() |
|
|
|
LogPrintf("RandomX cache is null, something is wrong, cannot mine!\n"); |
|
|
|
return; |
|
|
|
} |
|
|
|
fprintf(stderr,"RandomXMiner: created randomx flags + cache\n"); |
|
|
|
// fprintf(stderr,"RandomXMiner: created randomx flags + cache\n");
|
|
|
|
|
|
|
|
// With the defaults of 1024 and 64
|
|
|
|
// the key block will change every ~21.3 hours with a 75s block time
|
|
|
|