mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-22 23:42:24 +00:00
Merge pull request #8831
1d1d5fb
Fixed RandomX initialization when mining from scratch (SChernykh)
This commit is contained in:
commit
5c900bb69f
1 changed files with 8 additions and 1 deletions
|
@ -523,7 +523,7 @@ namespace cryptonote
|
||||||
bool miner::worker_thread()
|
bool miner::worker_thread()
|
||||||
{
|
{
|
||||||
const uint32_t th_local_index = m_thread_index++; // atomically increment, getting value before increment
|
const uint32_t th_local_index = m_thread_index++; // atomically increment, getting value before increment
|
||||||
crypto::rx_set_miner_thread(th_local_index, tools::get_max_concurrency());
|
bool rx_set = false;
|
||||||
|
|
||||||
MLOG_SET_THREAD_NAME(std::string("[miner ") + std::to_string(th_local_index) + "]");
|
MLOG_SET_THREAD_NAME(std::string("[miner ") + std::to_string(th_local_index) + "]");
|
||||||
MGINFO("Miner thread was started ["<< th_local_index << "]");
|
MGINFO("Miner thread was started ["<< th_local_index << "]");
|
||||||
|
@ -575,6 +575,13 @@ namespace cryptonote
|
||||||
|
|
||||||
b.nonce = nonce;
|
b.nonce = nonce;
|
||||||
crypto::hash h;
|
crypto::hash h;
|
||||||
|
|
||||||
|
if ((b.major_version >= RX_BLOCK_VERSION) && !rx_set)
|
||||||
|
{
|
||||||
|
crypto::rx_set_miner_thread(th_local_index, tools::get_max_concurrency());
|
||||||
|
rx_set = true;
|
||||||
|
}
|
||||||
|
|
||||||
m_gbh(b, height, NULL, tools::get_max_concurrency(), h);
|
m_gbh(b, height, NULL, tools::get_max_concurrency(), h);
|
||||||
|
|
||||||
if(check_hash(h, local_diff))
|
if(check_hash(h, local_diff))
|
||||||
|
|
Loading…
Reference in a new issue