Skip to content
This repository has been archived by the owner on Oct 28, 2021. It is now read-only.

Cap max incoming new block hashes at c_maxIncomingNewHashes #5676

Merged
merged 2 commits into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- Changed: [#5648](https://github.com/ethereum/aleth/pull/5648) `BlockChainTests` suite is split into `BlockChainTests/ValidBlocks` and `BlockChainTests/InvalidBlocks`.
- Changed: [#5678](https://github.com/ethereum/aleth/pull/5678) Enable optimizer in aleth-interpreter by default.
- Changed: [#5675](https://github.com/ethereum/aleth/pull/5675) Disconnect from peer when syncing is disabled for peer.
- Changed: [#5676](https://github.com/ethereum/aleth/pull/5676) When receiving large batches of new block hashes, process up to 1024 hashes instead of disabling the peer.
- Removed: [#5631](https://github.com/ethereum/aleth/pull/5631) Removed PARANOID build option.
- Fixed: [#5562](https://github.com/ethereum/aleth/pull/5562) Don't send header request messages to peers that haven't sent us Status yet.
- Fixed: [#5581](https://github.com/ethereum/aleth/pull/5581) Fixed finding neighbour nodes in Discovery.
Expand Down
5 changes: 3 additions & 2 deletions libethereum/EthereumCapability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,9 @@ bool EthereumCapability::interpretCapabilityPacket(

if (itemCount > c_maxIncomingNewHashes)
{
disablePeer(_peerID, "Too many new hashes");
break;
LOG(m_logger) << "Received too many hashes (" << itemCount << ") from " << _peerID
<< ", only processing first " << c_maxIncomingNewHashes << " hashes";
itemCount = c_maxIncomingNewHashes;
}

vector<pair<h256, u256>> hashes(itemCount);
Expand Down