Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Commit

Permalink
Don't crash the data server if uncles are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
carver committed May 30, 2019
1 parent 0fbcf85 commit 9d5d704
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion trinity/protocol/eth/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,13 @@ async def handle_get_block_bodies(self, peer: ETHPeer, block_hashes: Sequence[Ha
exc,
)
continue
uncles = await self.wait(self.db.coro_get_block_uncles(header.uncles_hash))
try:
uncles = await self.wait(self.db.coro_get_block_uncles(header.uncles_hash))
except HeaderNotFound as exc:
self.logger.debug(
"%s asked for a block with uncles we don't have: %s", peer, exc
)
continue
bodies.append(BlockBody(transactions, uncles))
self.logger.debug2("Replying to %s with %d block bodies", peer, len(bodies))
peer.sub_proto.send_block_bodies(bodies)
Expand Down

0 comments on commit 9d5d704

Please sign in to comment.