Skip to content

Commit

Permalink
Merge pull request #119 from cyberway/112-get-active-producers-fix
Browse files Browse the repository at this point in the history
Fix get_active_producers in eosiolib #112
  • Loading branch information
afalaleev authored Oct 1, 2019
2 parents 89ac514 + 11f74a9 commit 90b9f37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libraries/eosiolib/eosiolib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ 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;
auto buffer_size = get_active_producers(nullptr, 0);
std::vector<name> active_prods(buffer_size / sizeof(uint64_t));
get_active_producers((uint64_t*)active_prods.data(), buffer_size);
return active_prods;
}

} // namespace eosio

0 comments on commit 90b9f37

Please sign in to comment.