getEpochInfo RPC endpoint now includes the current block height

This commit is contained in:
Michael Vines
2020-07-21 14:43:48 -07:00
parent 231e2387db
commit a5dd848702
3 changed files with 7 additions and 1 deletions

View File

@ -2938,6 +2938,7 @@ impl Bank {
pub fn get_epoch_info(&self) -> EpochInfo {
let absolute_slot = self.slot();
let block_height = self.block_height();
let (epoch, slot_index) = self.get_epoch_and_slot_index(absolute_slot);
let slots_in_epoch = self.get_slots_in_epoch(epoch);
EpochInfo {
@ -2945,6 +2946,7 @@ impl Bank {
slot_index,
slots_in_epoch,
absolute_slot,
block_height,
}
}