Add a way to re-hash the bank (#10765)

This commit is contained in:
sakridge
2020-07-06 12:42:41 -07:00
committed by GitHub
parent 4de0713aa3
commit 1269e348fb
2 changed files with 20 additions and 1 deletions

View File

@ -817,6 +817,15 @@ impl Bank {
}
}
pub fn rehash(&self) {
let mut hash = self.hash.write().unwrap();
let new = self.hash_internal_state();
if new != *hash {
warn!("Updating bank hash to {}", new);
*hash = new;
}
}
pub fn freeze(&self) {
let mut hash = self.hash.write().unwrap();