Skip to content

Commit

Permalink
Merge pull request #1640 from theQRL/dev
Browse files Browse the repository at this point in the history
Merged Dev
  • Loading branch information
cyyber authored Nov 7, 2019
2 parents 8da840f + 55aa97d commit 130044c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qrl/services/PublicAPIService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 130044c

Please sign in to comment.