Integrate proto_array into lighthouse

This commit is contained in:
Paul Hauner
2020-01-14 17:05:59 +11:00
parent 0f9d0ff3b9
commit b8d33ae26b
12 changed files with 259 additions and 345 deletions

View File

@@ -201,6 +201,10 @@ impl ProtoArrayForkChoice {
self.proto_array.read().nodes.len()
}
pub fn contains_block(&self, block_root: &Hash256) -> bool {
self.proto_array.read().indices.contains_key(block_root)
}
pub fn latest_message(&self, validator_index: usize) -> Option<(Hash256, Epoch)> {
let votes = self.votes.read();