precomputed block hashes are now in blocks of N (currently 256)

This shaves a lot of space off binaries
This commit is contained in:
moneromooo-monero 2017-09-13 21:03:04 +01:00
parent 1a73843cec
commit 7adceee634
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
12 changed files with 182 additions and 12 deletions

View file

@ -1583,10 +1583,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))
{