From 85e5fbeb358122fb9d8995ad4188541592b5ef8a Mon Sep 17 00:00:00 2001 From: Tyera Eulberg Date: Mon, 2 Sep 2019 12:21:06 -0700 Subject: [PATCH] Add absoluteSlot to getEpochInfo (#5765) --- core/src/rpc.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/rpc.rs b/core/src/rpc.rs index 8841795e71..423b4b5688 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -274,6 +274,9 @@ pub struct RpcEpochInfo { /// The number of slots in this epoch pub slots_in_epoch: u64, + + /// The absolute current slot + pub absolute_slot: u64, } #[derive(Serialize, Deserialize, Clone, Debug)] @@ -464,10 +467,12 @@ impl RpcSol for RpcSolImpl { let bank = meta.request_processor.read().unwrap().bank(); let epoch_schedule = bank.epoch_schedule(); let (epoch, slot_index) = epoch_schedule.get_epoch_and_slot_index(bank.slot()); + let slot = bank.slot(); Ok(RpcEpochInfo { epoch, slot_index, slots_in_epoch: epoch_schedule.get_slots_in_epoch(epoch), + absolute_slot: slot, }) }