Add logging in check_blockstore_max_root (#13887) (#13888)

(cherry picked from commit 8fd1e55805)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
This commit is contained in:
mergify[bot]
2020-12-01 09:01:09 +00:00
committed by GitHub
parent 3955778cb6
commit 446e02bad1

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(())