mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-08-15 01:03:23 +00:00
cryptonote_protocol: sanity check chain hashes from peer
This commit is contained in:
parent
25584f8639
commit
46d6fa35c9
1 changed files with 6 additions and 0 deletions
|
@ -1585,6 +1585,12 @@ skip:
|
||||||
drop_connection(context, true, false);
|
drop_connection(context, true, false);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
if (arg.total_height < arg.m_block_ids.size() || arg.start_height > arg.total_height - arg.m_block_ids.size())
|
||||||
|
{
|
||||||
|
LOG_ERROR_CCONTEXT("sent invalid start/nblocks/height, dropping connection");
|
||||||
|
drop_connection(context, true, false);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
context.m_remote_blockchain_height = arg.total_height;
|
context.m_remote_blockchain_height = arg.total_height;
|
||||||
context.m_last_response_height = arg.start_height + arg.m_block_ids.size()-1;
|
context.m_last_response_height = arg.start_height + arg.m_block_ids.size()-1;
|
||||||
|
|
Loading…
Reference in a new issue