Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
put buffer_size as a second argument to get_active_producers
Browse files Browse the repository at this point in the history
  • Loading branch information
gBaGu authored and Bucky Kittinger committed Sep 27, 2019
1 parent bd71437 commit 7968a44
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libraries/eosiolib/eosiolib.cpp
Expand Up @@ -55,10 +55,11 @@ namespace eosio {
}

std::vector<name> get_active_producers() {
auto prod_cnt = get_active_producers(nullptr, 0)/8;
std::vector<name> active_prods(prod_cnt);
get_active_producers((uint64_t*)active_prods.data(), active_prods.size());
return active_prods;
const auto buffer_size = get_active_producers(nullptr, 0);
const auto prod_cnt = buffer_size / sizeof(name);
std::vector<name> active_prods(prod_cnt);
get_active_producers((uint64_t*)active_prods.data(), buffer_size);
return active_prods;
}

// powers.hpp
Expand Down

0 comments on commit 7968a44

Please sign in to comment.