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

Commit

Permalink
Add logging in check_blockstore_max_root (#13887) (#13888)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8fd1e55)

Co-authored-by: Tyera Eulberg <[email protected]>
  • Loading branch information
mergify[bot] and CriesofCarrots authored Dec 1, 2020
1 parent 3955778 commit 446e02b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions core/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit 446e02b

Please sign in to comment.