Use Height struct in optimised_lmd_ghost.
This commit is contained in:
parent
b2cda28835
commit
cb9f24224d
@ -315,7 +315,7 @@ impl<T: ClientDB + Sized> ForkChoice for OptimisedLMDGhost<T> {
|
|||||||
.get_reader(&target_block_root)?
|
.get_reader(&target_block_root)?
|
||||||
.ok_or_else(|| ForkChoiceError::MissingBeaconBlock(*target_block_root))?
|
.ok_or_else(|| ForkChoiceError::MissingBeaconBlock(*target_block_root))?
|
||||||
.slot()
|
.slot()
|
||||||
- GENESIS_SLOT;
|
.height(Slot::from(GENESIS_SLOT));
|
||||||
|
|
||||||
// get the height of the past target block
|
// get the height of the past target block
|
||||||
let past_block_height = self
|
let past_block_height = self
|
||||||
@ -323,7 +323,7 @@ impl<T: ClientDB + Sized> ForkChoice for OptimisedLMDGhost<T> {
|
|||||||
.get_reader(&attestation_target)?
|
.get_reader(&attestation_target)?
|
||||||
.ok_or_else(|| ForkChoiceError::MissingBeaconBlock(*attestation_target))?
|
.ok_or_else(|| ForkChoiceError::MissingBeaconBlock(*attestation_target))?
|
||||||
.slot()
|
.slot()
|
||||||
- GENESIS_SLOT;
|
.height(Slot::from(GENESIS_SLOT));
|
||||||
// update the attestation only if the new target is higher
|
// update the attestation only if the new target is higher
|
||||||
if past_block_height < block_height {
|
if past_block_height < block_height {
|
||||||
*attestation_target = *target_block_root;
|
*attestation_target = *target_block_root;
|
||||||
|
Loading…
Reference in New Issue
Block a user