Refactor justified_slot fn

Now it reads from the head state
This commit is contained in:
Paul Hauner 2019-01-31 18:30:43 +11:00
parent 3f13c25c05
commit d6adfc7655
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -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)> {