Add logging in check_blockstore_max_root (#13887)

This commit is contained in:
Tyera Eulberg 2020-12-01 00:44:18 -07:00 committed by GitHub
parent 6705b5a98c
commit 8fd1e55805
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -610,10 +610,15 @@ impl JsonRpcRequestProcessor {
T: std::fmt::Debug,
{
if result.is_err() {
if let BlockstoreError::SlotNotRooted = result.as_ref().unwrap_err() {
if slot > self.blockstore.max_root() {
return Err(RpcCustomError::BlockNotAvailable { slot }.into());
}
let err = result.as_ref().unwrap_err();
debug!(
"check_blockstore_max_root, slot: {:?}, max root: {:?}, err: {:?}",
slot,
self.blockstore.max_root(),
err
);
if slot >= self.blockstore.max_root() {
return Err(RpcCustomError::BlockNotAvailable { slot }.into());
}
}
Ok(())