From 11f74a97c9e353dbbe41514cdd598fe656c4cf13 Mon Sep 17 00:00:00 2001 From: boostmultifruit Date: Thu, 29 Aug 2019 08:32:00 +0300 Subject: [PATCH] Fix get_active_producers in eosiolib #112 --- libraries/eosiolib/eosiolib.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/eosiolib/eosiolib.cpp b/libraries/eosiolib/eosiolib.cpp index 64c1791b8f..6ad03ac54d 100644 --- a/libraries/eosiolib/eosiolib.cpp +++ b/libraries/eosiolib/eosiolib.cpp @@ -49,10 +49,10 @@ namespace eosio { } std::vector get_active_producers() { - auto prod_cnt = get_active_producers(nullptr, 0)/8; - std::vector 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 active_prods(buffer_size / sizeof(uint64_t)); + get_active_producers((uint64_t*)active_prods.data(), buffer_size); + return active_prods; } } // namespace eosio