mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Add first implementation of optimised LMD ghost.
- Implements the optimised lmd-ghost fork choice rule. - Removes Attestations struct. - Removes latest_attestation_targets from beacon_chain.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
use std::collections::HashMap;
|
||||
use types::Hash256;
|
||||
|
||||
pub struct AttestationTargets {
|
||||
map: HashMap<u64, Hash256>,
|
||||
}
|
||||
|
||||
impl AttestationTargets {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
map: HashMap::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get(&self, validator_index: u64) -> Option<&Hash256> {
|
||||
self.map.get(&validator_index)
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, validator_index: u64, block_hash: Hash256) -> Option<Hash256> {
|
||||
self.map.insert(validator_index, block_hash)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user