Fix off by one in broadcast_confirm_req_batch (#2280)

This commit is contained in:
Guilherme Lawless 2019-09-04 11:30:50 +01:00 committed by GitHub
commit 05e685a595
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -335,7 +335,7 @@ void nano::network::broadcast_confirm_req_batch (std::unordered_map<std::shared_
count++;
std::vector<std::pair<nano::block_hash, nano::block_hash>> roots_hashes;
// Limit max request size hash + root to 7 pairs
while (roots_hashes.size () <= confirm_req_hashes_max && !j->second.empty ())
while (roots_hashes.size () < confirm_req_hashes_max && !j->second.empty ())
{
roots_hashes.push_back (j->second.back ());
j->second.pop_back ();