From d6adfc7655a170999e77090a3a00d5c73e9ddd7e Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 31 Jan 2019 18:30:43 +1100 Subject: [PATCH] Refactor justified_slot fn Now it reads from the head state --- beacon_node/beacon_chain/src/info.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/beacon_node/beacon_chain/src/info.rs b/beacon_node/beacon_chain/src/info.rs index a67af7f39..e23aaef78 100644 --- a/beacon_node/beacon_chain/src/info.rs +++ b/beacon_node/beacon_chain/src/info.rs @@ -56,11 +56,18 @@ where } pub fn justified_slot(&self) -> u64 { + // TODO: fix unwrap + let present_slot = self.present_slot().unwrap(); + // TODO: fix unwrap + let state = self.state(present_slot).unwrap(); + state.justified_slot + /* self.justified_head .read() .expect("Justified head poisoned") .beacon_block .slot + */ } pub fn validator_attestion_slot_and_shard(&self, validator_index: usize) -> Option<(u64, u64)> {