Skip to content

Commit 68357e0

Browse files
authored
Merge pull request #911 from openmina/fix/next-won-slot-status
fix(rpc): Fix `next_won_slot`
2 parents 59f9299 + c1c8d75 commit 68357e0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

node/src/rpc_effectful/rpc_effectful_effects.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,9 @@ macro_rules! respond_or_log {
4949

5050
fn get_next_won_slot(state: &State) -> Option<BlockProductionAttemptWonSlot> {
5151
let best_tip = state.transition_frontier.best_tip()?;
52+
let cur_global_slot = state.cur_global_slot()?;
5253
let vrf = state.block_producer.vrf_evaluator()?;
53-
let (_, won_slot) = vrf.won_slots.first_key_value()?;
54-
55-
let won_slot = BlockProducerWonSlot::from_vrf_won_slot(won_slot, best_tip.genesis_timestamp());
54+
let won_slot = vrf.next_won_slot(cur_global_slot, best_tip)?;
5655
Some((&won_slot).into())
5756
}
5857

0 commit comments

Comments
 (0)