Prevent coredump when randomxBlockKey changes

This commit is contained in:
Duke Leto
2022-07-01 18:37:59 -04:00
parent 1864b83e99
commit 71a72c9c60
2 changed files with 4 additions and 4 deletions

View File

@@ -1233,9 +1233,9 @@ void static RandomXMiner()
int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval;
fprintf(stderr,"RandomXMiner: key height=%d\n", keyHeight);
uint256 randomxBlockKey = chainActive[keyHeight]->GetBlockHash();
crypto_generichash_blake2b_state new_state;
crypto_generichash_blake2b_update(&state, (unsigned char *)&randomxBlockKey, 32);
crypto_generichash_blake2b_final(&state, randomxInput, 32);
//crypto_generichash_blake2b_state new_state;
//crypto_generichash_blake2b_update(&new_state, (unsigned char *)&randomxBlockKey, 32);
//crypto_generichash_blake2b_final(&new_state, randomxInput, 32);
randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxKey);
fprintf(stderr,"RandomXMiner: initialized cache with randomxBlockKey=%s\n", randomxBlockKey.ToString().c_str());