Merge pull request #7975

48a0997 blockchain: fix pedantic assert (selsta)
This commit is contained in:
luigi1111 2021-10-11 13:00:27 -05:00
commit 3d9c805e23
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010
1 changed files with 2 additions and 0 deletions

View File

@ -5021,6 +5021,8 @@ bool Blockchain::prepare_handle_incoming_blocks(const std::vector<block_complete
unsigned nblocks = batches; unsigned nblocks = batches;
if (i < extra) if (i < extra)
++nblocks; ++nblocks;
if (nblocks == 0)
break;
tpool.submit(&waiter, boost::bind(&Blockchain::block_longhash_worker, this, thread_height, epee::span<const block>(&blocks[thread_height - height], nblocks), std::ref(maps[i])), true); tpool.submit(&waiter, boost::bind(&Blockchain::block_longhash_worker, this, thread_height, epee::span<const block>(&blocks[thread_height - height], nblocks), std::ref(maps[i])), true);
thread_height += nblocks; thread_height += nblocks;
} }