Make set roots an iterator (#18357) (#18377)

(cherry picked from commit 0eca92de18)

Co-authored-by: carllin <carl@solana.com>
This commit is contained in:
mergify[bot]
2021-07-02 04:44:38 +00:00
committed by GitHub
parent 8f08953100
commit c7d0aea5f4
11 changed files with 58 additions and 46 deletions

View File

@@ -2917,10 +2917,12 @@ fn main() {
eprintln!("{} slots to be rooted", roots_to_fix.len());
for chunk in roots_to_fix.chunks(100) {
eprintln!("{:?}", chunk);
blockstore.set_roots(&roots_to_fix).unwrap_or_else(|err| {
eprintln!("Unable to set roots {:?}: {}", roots_to_fix, err);
exit(1);
});
blockstore
.set_roots(roots_to_fix.iter())
.unwrap_or_else(|err| {
eprintln!("Unable to set roots {:?}: {}", roots_to_fix, err);
exit(1);
});
}
} else {
println!(