<!--
{
  "availability" : [

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

# blockTreeEntry(byHash:)

Looks up a block tree entry by its block hash.

```
func blockTreeEntry(byHash hash: BlockHash) -> BlockTreeEntry?
```

## Parameters

`hash`

The block hash to look up.

## Return Value

The matching [`BlockTreeEntry`](/documentation/BitcoinKernel/BlockTreeEntry), or `nil` if the kernel
has no record of a block with that hash.

## Discussion

Searches the full block index — which includes blocks on side chains
the kernel has evaluated but not adopted, not just the active chain.
Cheap: backed by an in-memory hash table.