diff --git a/codex/stores/cachestore.nim b/codex/stores/cachestore.nim index 8521ae5b..7ac6fa05 100644 --- a/codex/stores/cachestore.nim +++ b/codex/stores/cachestore.nim @@ -55,16 +55,10 @@ method getBlock*( trace "Empty block, ignoring" return cid.emptyBlock.success -# if cid notin self.cache: -# return Block.failure("Block not found") # TODO: return nil + if cid notin self.cache: + return Block.failure("Block not found") # TODO: return nil - try: - let x = self.cache[cid] - return x.success - except CatchableError as e: - return Block.failure(e) - -# return self.cache[cid].catch() + return self.cache[cid] method hasBlock*(self: CacheStore, cid: Cid): Future[?!bool] {.async.} = ## Check if the block exists in the blockstore