Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random cleanup #3192

Merged
merged 3 commits into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions core/src/blocktree_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,6 @@ pub fn process_entries(bank: &Bank, entries: &[Entry]) -> Result<()> {
par_process_entries(bank, entries)
}

/// Process an ordered list of entries, populating a circular buffer "tail"
/// as we go.
fn process_block(bank: &Bank, entries: &[Entry]) -> Result<()> {
for entry in entries {
process_entry(bank, entry)?;
}

Ok(())
}

#[derive(Debug, PartialEq)]
pub struct BankForksInfo {
pub bank_slot: u64,
Expand Down Expand Up @@ -167,7 +157,7 @@ pub fn process_blocktree(
return Err(BankError::LedgerVerificationFailed);
}

process_block(&bank, &entries).map_err(|err| {
process_entries(&bank, &entries).map_err(|err| {
warn!("Failed to process entries for slot {}: {:?}", slot, err);
BankError::LedgerVerificationFailed
})?;
Expand Down
4 changes: 2 additions & 2 deletions core/src/crds_gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ impl CrdsGossip {
}

/// time when a request to `from` was initiated
/// This is used for weighted random selection durring `new_pull_request`
/// This is used for weighted random selection during `new_pull_request`
/// It's important to use the local nodes request creation time as the weight
/// instaad of the response received time otherwise failed nodes will increase their weight.
/// instead of the response received time otherwise failed nodes will increase their weight.
pub fn mark_pull_request_creation_time(&mut self, from: Pubkey, now: u64) {
self.pull.mark_pull_request_creation_time(from, now)
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ impl LocalCluster {
}
}

pub fn close(&mut self) {
fn close(&mut self) {
self.close_preserve_ledgers();
for path in &self.ledger_paths {
remove_dir_all(path).unwrap();
remove_dir_all(path).unwrap_or_else(|_| panic!("Unable to remove {}", path));
}
}

Expand Down