@@ -17,11 +17,10 @@ use crate::{
1717 RpcTransactionInjectResponse , TransactionStatus ,
1818 } ,
1919 snark_pool:: SnarkPoolAction ,
20- stats:: block_producer:: BlockProductionAttemptWonSlot ,
2120 transition_frontier:: sync:: {
2221 ledger:: TransitionFrontierSyncLedgerState , TransitionFrontierSyncState ,
2322 } ,
24- Service , State , Store ,
23+ Service , Store ,
2524} ;
2625use ledger:: {
2726 scan_state:: currency:: { Balance , Magnitude } ,
@@ -47,14 +46,6 @@ macro_rules! respond_or_log {
4746 } ;
4847}
4948
50- fn get_next_won_slot ( state : & State ) -> Option < BlockProductionAttemptWonSlot > {
51- let best_tip = state. transition_frontier . best_tip ( ) ?;
52- let cur_global_slot = state. cur_global_slot ( ) ?;
53- let vrf = state. block_producer . vrf_evaluator ( ) ?;
54- let won_slot = vrf. next_won_slot ( cur_global_slot, best_tip) ?;
55- Some ( ( & won_slot) . into ( ) )
56- }
57-
5849pub fn rpc_effects < S : Service > ( store : & mut Store < S > , action : ActionWithMeta < RpcEffectfulAction > ) {
5950 let ( action, meta) = action. split ( ) ;
6051
@@ -73,7 +64,10 @@ pub fn rpc_effects<S: Service>(store: &mut Store<S>, action: ActionWithMeta<RpcE
7364 height : b. height ( ) ,
7465 global_slot : b. global_slot ( ) ,
7566 } ;
76- let next_won_slot = get_next_won_slot ( state) ;
67+ let current_block_production_attempt = store
68+ . service
69+ . stats ( )
70+ . and_then ( |stats| Some ( stats. block_producer ( ) . collect_attempts ( ) . last ( ) ?. clone ( ) ) ) ;
7771 let status = RpcNodeStatus {
7872 chain_id,
7973 transition_frontier : RpcNodeStatusTransitionFrontier {
@@ -99,7 +93,7 @@ pub fn rpc_effects<S: Service>(store: &mut Store<S>, action: ActionWithMeta<RpcE
9993 transaction_pool : RpcNodeStatusTransactionPool {
10094 transactions : state. transaction_pool . size ( ) ,
10195 } ,
102- next_won_slot ,
96+ current_block_production_attempt ,
10397 } ;
10498 let _ = store. service . respond_status_get ( rpc_id, Some ( status) ) ;
10599 }
0 commit comments