Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
Assert there's no active scheduler before freezing
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Apr 23, 2023
1 parent 3ba582b commit 4dbbcbd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3236,6 +3236,10 @@ impl Bank {
// committed before this write lock can be obtained here.
let mut hash = self.hash.write().unwrap();
if *hash == Hash::default() {
// there should be no active scheduler at this point, which
// might be actively mutating bank state...
assert!(!self.with_scheduler());

// finish up any deferred changes to account state
self.collect_rent_eagerly();
self.collect_fees();
Expand Down

0 comments on commit 4dbbcbd

Please sign in to comment.