core: fix mining from a block that's not the current top

This commit is contained in:
moneromooo-monero 2019-11-08 17:30:18 +00:00
parent c695470cff
commit 9d42649d58
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
10 changed files with 89 additions and 47 deletions

View file

@ -407,9 +407,9 @@ void test_generator::fill_nonce(cryptonote::block& blk, const difficulty_type& d
}
blk.nonce = 0;
while (!miner::find_nonce_for_given_block([blockchain](const cryptonote::block &b, uint64_t height, unsigned int threads, crypto::hash &hash){
return cryptonote::get_block_longhash(blockchain, b, hash, height, threads);
}, blk, diffic, height)) {
while (!miner::find_nonce_for_given_block([blockchain](const cryptonote::block &b, uint64_t height, const crypto::hash *seed_hash, unsigned int threads, crypto::hash &hash){
return cryptonote::get_block_longhash(blockchain, b, hash, height, seed_hash, threads);
}, blk, diffic, height, NULL)) {
blk.timestamp++;
}
}