Skip to content

Commit

Permalink
GH-2045 Fix when active_producer_policy updated, done at end of block…
Browse files Browse the repository at this point in the history
… not at beginning.
  • Loading branch information
heifner committed Jan 14, 2024
1 parent 4e631ae commit abdfa68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/chain/block_header_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ block_header_state block_header_state::next(block_header_state_input& input) con

if(!proposer_policies.empty()) {
auto it = proposer_policies.begin();
if (it->first <= input.timestamp) {
// -1 since this is called after the block is built, this will be the active schedule for the next block
if (it->first.slot <= input.timestamp.slot - 1) {
result.active_proposer_policy = it->second;
result.header.schedule_version = header.schedule_version + 1;
result.active_proposer_policy->proposer_schedule.version = result.header.schedule_version;
Expand Down

0 comments on commit abdfa68

Please sign in to comment.