Reduce locking in Blocktree (#4075)

* Reduce lock contention in blocktree

* Store root slot in separate column
This commit is contained in:
Mark E. Sinclair
2019-05-03 16:46:02 -05:00
committed by GitHub
parent f91627a230
commit ed48d8323c
6 changed files with 217 additions and 172 deletions

View File

@ -201,7 +201,7 @@ impl RepairService {
fn generate_repairs(blocktree: &Blocktree, max_repairs: usize) -> Result<(Vec<RepairType>)> {
// Slot height and blob indexes for blobs we want to repair
let mut repairs: Vec<RepairType> = vec![];
let slot = *blocktree.root_slot.read().unwrap();
let slot = blocktree.get_root()?;
Self::generate_repairs_for_fork(blocktree, &mut repairs, max_repairs, slot);
// TODO: Incorporate gossip to determine priorities for repair?