Skip to content

Commit

Permalink
GH-1541 minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Aug 28, 2023
1 parent cb8bc49 commit a7fc539
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libraries/chain/include/eosio/chain/finalizer_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ namespace eosio::chain {
}

uint32_t version = 0; ///< sequentially incrementing version number
uint64_t fthreshold; // vote fweight threshold to finalize blocks
uint64_t fthreshold = 0; // vote fweight threshold to finalize blocks
vector<finalizer_authority> finalizers; // Instant Finality voter set

friend bool operator == ( const finalizer_set& a, const finalizer_set& b )
Expand Down
5 changes: 4 additions & 1 deletion libraries/hotstuff/chain_pacemaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ namespace eosio { namespace hotstuff {
void chain_pacemaker::on_accepted_block( const block_state_ptr& blk ) {
std::scoped_lock g( _chain_state_mutex );
_head_block_state = blk;
// TODO only update local cache if changed, check version or use !=
_finalizer_set = _chain->get_finalizers(); // TODO get from chainbase or from block_state
}

Expand Down Expand Up @@ -253,9 +254,11 @@ namespace eosio { namespace hotstuff {
//
std::unique_lock g( _chain_state_mutex );
const auto& fin_set = _chain->get_finalizers(); // TODO use
block_state_ptr hbs = _head_block_state;
g.unlock();

// Old code: get eosio::name from the producer schedule
const std::vector<producer_authority>& pa_list = _head_block_state->active_schedule.producers;
const std::vector<producer_authority>& pa_list = hbs->active_schedule.producers;
std::vector<name> pn_list;
pn_list.reserve(pa_list.size());
std::transform(pa_list.begin(), pa_list.end(),
Expand Down

0 comments on commit a7fc539

Please sign in to comment.