File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -468,6 +468,7 @@ pub struct RpcNodeStatus {
468
468
pub snark_pool : RpcNodeStatusSnarkPool ,
469
469
pub transaction_pool : RpcNodeStatusTransactionPool ,
470
470
pub current_block_production_attempt : Option < BlockProductionAttempt > ,
471
+ pub previous_block_production_attempt : Option < BlockProductionAttempt > ,
471
472
pub peers : Vec < RpcPeerInfo > ,
472
473
pub resources_status : RpcNodeStatusResources ,
473
474
pub service_queues : Queues ,
Original file line number Diff line number Diff line change @@ -788,10 +788,20 @@ fn compute_node_status<S: Service>(store: &mut Store<S>) -> RpcNodeStatus {
788
788
height : b. height ( ) ,
789
789
global_slot : b. global_slot ( ) ,
790
790
} ;
791
- let current_block_production_attempt = store
791
+
792
+ let block_production_attempts = store
792
793
. service
793
794
. stats ( )
794
- . and_then ( |stats| Some ( stats. block_producer ( ) . collect_attempts ( ) . last ( ) ?. clone ( ) ) ) ;
795
+ . map_or_else ( Vec :: new, |stats| stats. block_producer ( ) . collect_attempts ( ) ) ;
796
+
797
+ let current_block_production_attempt = block_production_attempts. last ( ) . cloned ( ) ;
798
+
799
+ let previous_block_production_attempt = block_production_attempts
800
+ . len ( )
801
+ . checked_sub ( 2 )
802
+ . and_then ( |idx| block_production_attempts. get ( idx) )
803
+ . cloned ( ) ;
804
+
795
805
let status = RpcNodeStatus {
796
806
chain_id,
797
807
transition_frontier : RpcNodeStatusTransitionFrontier {
@@ -835,6 +845,7 @@ fn compute_node_status<S: Service>(store: &mut Store<S>) -> RpcNodeStatus {
835
845
transaction_candidates : state. transaction_pool . candidates . transactions_count ( ) ,
836
846
} ,
837
847
current_block_production_attempt,
848
+ previous_block_production_attempt,
838
849
resources_status : RpcNodeStatusResources {
839
850
p2p_malloc_size : {
840
851
let mut set = BTreeSet :: new ( ) ;
You can’t perform that action at this time.
0 commit comments