mirror of
https://github.com/monero-project/monero.git
synced 2025-07-28 13:44:12 -04:00
Merge pull request #2469
7adceee6
precomputed block hashes are now in blocks of N (currently 256) (moneromooo-monero)
This commit is contained in:
commit
5ea20d6944
12 changed files with 182 additions and 12 deletions
|
@ -1579,10 +1579,22 @@ skip:
|
|||
return 1;
|
||||
}
|
||||
|
||||
uint64_t n_use_blocks = m_core.prevalidate_block_hashes(arg.start_height, arg.m_block_ids);
|
||||
if (n_use_blocks == 0)
|
||||
{
|
||||
LOG_ERROR_CCONTEXT("Peer yielded no usable blocks, dropping connection");
|
||||
drop_connection(context, false, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint64_t added = 0;
|
||||
for(auto& bl_id: arg.m_block_ids)
|
||||
{
|
||||
context.m_needed_objects.push_back(bl_id);
|
||||
if (++added == n_use_blocks)
|
||||
break;
|
||||
}
|
||||
context.m_last_response_height -= arg.m_block_ids.size() - n_use_blocks;
|
||||
|
||||
if (!request_missing_objects(context, false))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue