Refactor RPC subscriptions account handling (#9888) (#9912)

automerge
This commit is contained in:
mergify[bot]
2020-05-07 01:14:58 -07:00
committed by GitHub
parent 9a5fc3513a
commit 558324b861
10 changed files with 464 additions and 277 deletions

View File

@@ -1799,12 +1799,14 @@ impl Bank {
}
pub fn get_account(&self, pubkey: &Pubkey) -> Option<Account> {
self.rc
.accounts
.load_slow(&self.ancestors, pubkey)
self.get_account_modified_slot(pubkey)
.map(|(acc, _slot)| acc)
}
pub fn get_account_modified_slot(&self, pubkey: &Pubkey) -> Option<(Account, Slot)> {
self.rc.accounts.load_slow(&self.ancestors, pubkey)
}
// Exclude self to really fetch the parent Bank's account hash and data.
//
// Being idempotent is needed to make the lazy initialization possible,