Fall back to root if highest_confirmed_slot bank does not exist (#11390)

This commit is contained in:
Tyera Eulberg
2020-08-05 16:08:20 -06:00
committed by GitHub
parent 7b8e5a9f47
commit 74cdfc2213

View File

@ -121,7 +121,10 @@ impl JsonRpcRequestProcessor {
.unwrap()
.highest_confirmed_slot();
debug!("RPC using confirmed slot: {:?}", slot);
Ok(r_bank_forks.get(slot).cloned().unwrap())
Ok(r_bank_forks
.get(slot)
.cloned()
.unwrap_or_else(|| r_bank_forks.root_bank().clone()))
}
CommitmentLevel::Max => {
let cluster_root = self