delay freeze of status_cache until squash (#3453)

This commit is contained in:
Rob Walker 2019-03-22 22:14:56 -07:00 committed by GitHub
parent 6505221629
commit 31b8743052
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -261,7 +261,11 @@ impl Bank {
let parent_caches: Vec<_> = parents
.iter()
.map(|b| b.status_cache.read().unwrap())
.map(|p| {
let mut parent = p.status_cache.write().unwrap();
parent.freeze();
parent
})
.collect();
self.status_cache.write().unwrap().squash(&parent_caches);
}