|
|
@ -393,12 +393,18 @@ void test_generator::fill_nonce(cryptonote::block& blk, const difficulty_type& d
|
|
|
|
const cryptonote::Blockchain *blockchain = nullptr;
|
|
|
|
const cryptonote::Blockchain *blockchain = nullptr;
|
|
|
|
std::unique_ptr<cryptonote::Blockchain> bc;
|
|
|
|
std::unique_ptr<cryptonote::Blockchain> bc;
|
|
|
|
|
|
|
|
|
|
|
|
if (blk.major_version >= RX_BLOCK_VERSION)
|
|
|
|
if (blk.major_version >= RX_BLOCK_VERSION && diffic > 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (m_events == nullptr)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
MDEBUG("events not set, RandomX PoW can fail due to zero seed hash");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CHECK_AND_ASSERT_THROW_MES(m_events != nullptr, "events not set, cannot compute valid RandomX PoW");
|
|
|
|
|
|
|
|
bc = init_blockchain(*m_events, m_nettype);
|
|
|
|
bc = init_blockchain(*m_events, m_nettype);
|
|
|
|
blockchain = bc.get();
|
|
|
|
blockchain = bc.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
blk.nonce = 0;
|
|
|
|
blk.nonce = 0;
|
|
|
|
while (!miner::find_nonce_for_given_block([blockchain](const cryptonote::block &b, uint64_t height, unsigned int threads, crypto::hash &hash){
|
|
|
|
while (!miner::find_nonce_for_given_block([blockchain](const cryptonote::block &b, uint64_t height, unsigned int threads, crypto::hash &hash){
|
|
|
|