Add chain.justified_head

This commit is contained in:
Paul Hauner
2019-01-28 13:00:08 +11:00
parent b516fd472e
commit d1ac7c037d
2 changed files with 16 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ pub struct BeaconChain<T: ClientDB + Sized, U: SlotClock> {
pub block_graph: BlockGraph,
canonical_head: RwLock<CheckPoint>,
finalized_head: RwLock<CheckPoint>,
justified_head: RwLock<CheckPoint>,
pub latest_attestation_targets: RwLock<AttestationTargets>,
pub spec: ChainSpec,
}
@@ -110,6 +111,12 @@ where
genesis_state.clone(),
state_root.clone(),
));
let justified_head = RwLock::new(CheckPoint::new(
genesis_block.clone(),
block_root.clone(),
genesis_state.clone(),
state_root.clone(),
));
let canonical_head = RwLock::new(CheckPoint::new(
genesis_block.clone(),
block_root.clone(),
@@ -124,6 +131,7 @@ where
state_store,
slot_clock,
block_graph,
justified_head,
finalized_head,
canonical_head,
latest_attestation_targets,