Rename chain.canonical_head
to head
This commit is contained in:
parent
acf8b79fe9
commit
b516fd472e
@ -121,7 +121,7 @@ where
|
||||
// If the parent block was the parent_block, automatically update the canonical head.
|
||||
//
|
||||
// TODO: this is a first-in-best-dressed scenario that is not ideal -- find a solution.
|
||||
if self.canonical_head().beacon_block_root == parent_block_root {
|
||||
if self.head().beacon_block_root == parent_block_root {
|
||||
self.update_canonical_head(
|
||||
block.clone(),
|
||||
block_root.clone(),
|
||||
|
@ -33,7 +33,7 @@ where
|
||||
.map_err(|e| e.into())?
|
||||
.ok_or(Error::PresentSlotIsNone)?;
|
||||
|
||||
let parent_root = self.canonical_head().beacon_block_root;
|
||||
let parent_root = self.head().beacon_block_root;
|
||||
let parent_block_reader = self
|
||||
.block_store
|
||||
.get_reader(&parent_root)?
|
||||
|
@ -19,11 +19,11 @@ where
|
||||
new_beacon_state: BeaconState,
|
||||
new_beacon_state_root: Hash256,
|
||||
) {
|
||||
let mut canonical_head = self
|
||||
let mut head = self
|
||||
.canonical_head
|
||||
.write()
|
||||
.expect("CRITICAL: CanonicalHead poisioned.");
|
||||
canonical_head.update(
|
||||
head.update(
|
||||
new_beacon_block,
|
||||
new_beacon_block_root,
|
||||
new_beacon_state,
|
||||
@ -31,7 +31,7 @@ where
|
||||
);
|
||||
}
|
||||
|
||||
pub fn canonical_head(&self) -> RwLockReadGuard<CheckPoint> {
|
||||
pub fn head(&self) -> RwLockReadGuard<CheckPoint> {
|
||||
self.canonical_head
|
||||
.read()
|
||||
.expect("CRITICAL: CanonicalHead poisioned.")
|
||||
|
@ -25,10 +25,10 @@ where
|
||||
let mut dump = vec![];
|
||||
|
||||
let mut last_slot = SlotDump {
|
||||
beacon_block: self.canonical_head().beacon_block.clone(),
|
||||
beacon_block_root: self.canonical_head().beacon_block_root,
|
||||
beacon_state: self.canonical_head().beacon_state.clone(),
|
||||
beacon_state_root: self.canonical_head().beacon_state_root,
|
||||
beacon_block: self.head().beacon_block.clone(),
|
||||
beacon_block_root: self.head().beacon_block_root,
|
||||
beacon_state: self.head().beacon_state.clone(),
|
||||
beacon_state_root: self.head().beacon_state_root,
|
||||
};
|
||||
|
||||
dump.push(last_slot.clone());
|
||||
|
@ -8,7 +8,7 @@ where
|
||||
{
|
||||
pub fn validator_index(&self, pubkey: &PublicKey) -> Option<usize> {
|
||||
for (i, validator) in self
|
||||
.canonical_head()
|
||||
.head()
|
||||
.beacon_state
|
||||
.validator_registry
|
||||
.iter()
|
||||
|
Loading…
Reference in New Issue
Block a user