Prevent coredump when randomxBlockKey changes
This commit is contained in:
@@ -1233,9 +1233,9 @@ void static RandomXMiner()
|
|||||||
int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval;
|
int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval;
|
||||||
fprintf(stderr,"RandomXMiner: key height=%d\n", keyHeight);
|
fprintf(stderr,"RandomXMiner: key height=%d\n", keyHeight);
|
||||||
uint256 randomxBlockKey = chainActive[keyHeight]->GetBlockHash();
|
uint256 randomxBlockKey = chainActive[keyHeight]->GetBlockHash();
|
||||||
crypto_generichash_blake2b_state new_state;
|
//crypto_generichash_blake2b_state new_state;
|
||||||
crypto_generichash_blake2b_update(&state, (unsigned char *)&randomxBlockKey, 32);
|
//crypto_generichash_blake2b_update(&new_state, (unsigned char *)&randomxBlockKey, 32);
|
||||||
crypto_generichash_blake2b_final(&state, randomxInput, 32);
|
//crypto_generichash_blake2b_final(&new_state, randomxInput, 32);
|
||||||
|
|
||||||
randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxKey);
|
randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxKey);
|
||||||
fprintf(stderr,"RandomXMiner: initialized cache with randomxBlockKey=%s\n", randomxBlockKey.ToString().c_str());
|
fprintf(stderr,"RandomXMiner: initialized cache with randomxBlockKey=%s\n", randomxBlockKey.ToString().c_str());
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
./src/hushd -ac_randomx_interval=20 -ac_randomx_lag=5 -ac_halving=30 -ac_algo=randomx -ac_name=RANDOMX2 -ac_private=1 -ac_blocktime=20 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1
|
./src/hushd -ac_randomx_interval=10 -ac_randomx_lag=3 -ac_halving=20 -ac_algo=randomx -ac_name=RANDOMX3 -ac_private=1 -ac_blocktime=20 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1
|
||||||
|
|
||||||
# to run via the debugger
|
# to run via the debugger
|
||||||
# type "run" when gdb prompt appears
|
# type "run" when gdb prompt appears
|
||||||
|
|||||||
Reference in New Issue
Block a user