diff --git a/src/qrl/services/PublicAPIService.py b/src/qrl/services/PublicAPIService.py index c58e3640a..5b4f26e15 100644 --- a/src/qrl/services/PublicAPIService.py +++ b/src/qrl/services/PublicAPIService.py @@ -256,7 +256,8 @@ def GetObject(self, request: qrl_pb2.GetObjectReq, context) -> qrl_pb2.GetObject # NOTE: This is temporary, indexes are accepted for blocks try: block = self.qrlnode.get_block_from_hash(query) - if block is None: + # The condition after or is to avoid a bug, where a block is deserialized by BlockNumberMapping + if block is None or (block.block_number == 0 and block.prev_headerhash != config.user.genesis_prev_headerhash): query_str = query.decode() query_index = int(query_str) block = self.qrlnode.get_block_from_index(query_index)