Skip to content

Commit

Permalink
GH-3 Fix: num_messages.clear() called before decrement
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Apr 11, 2024
1 parent bf545e3 commit d1fe636
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/chain/include/eosio/chain/vote_processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ class vote_processor_t {

bool remove_all_for_block(auto& idx, auto& it, const block_id_type& id) {
while (it != idx.end() && (*it)->id() == id) {
--num_messages[(*it)->connection_id];
if (auto& num = num_messages[(*it)->connection_id]; num != 0)
--num;

it = idx.erase(it);
}
return it == idx.end();
Expand Down

0 comments on commit d1fe636

Please sign in to comment.