From 446e02bad1433d036da3294b8c6c57757ec5a200 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 1 Dec 2020 09:01:09 +0000 Subject: [PATCH] Add logging in check_blockstore_max_root (#13887) (#13888) (cherry picked from commit 8fd1e558057ecbd162a3afc166badd30040123f5) Co-authored-by: Tyera Eulberg --- core/src/rpc.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/src/rpc.rs b/core/src/rpc.rs index f22f8afc4a..d4ee71d309 100644 --- a/core/src/rpc.rs +++ b/core/src/rpc.rs @@ -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(())