<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/ChainstateManager/readBlock(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel17ChainstateManagerC9readBlock2atAA0F0CSgAA0F9TreeEntryC_tF"
  },
  "title" : "readBlock(at:)"
}
-->

# readBlock(at:)

Reads a previously-processed block from disk by its block tree entry.

```
func readBlock(at entry: BlockTreeEntry) -> Block?
```

## Parameters

`entry`

The block tree entry pointing to the block.

## Return Value

The block, or `nil` on read failure.

## Discussion

Returns `nil` when the block index lists the entry but the block
body is not on disk — e.g., an in-memory chainstate, a pruned data
directory, or an entry from a side chain that was never fully
validated.