<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "BitcoinKernel",
  "identifier" : "/documentation/BitcoinKernel/BlockTreeEntry",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "BitcoinKernel"
    ],
    "preciseIdentifier" : "s:13BitcoinKernel14BlockTreeEntryC"
  },
  "title" : "BlockTreeEntry"
}
-->

# BlockTreeEntry

An entry in the block tree (block index) — a block the kernel has
validated, whether on the active chain or on a side chain.

```
final class BlockTreeEntry
```

## Overview

Obtained from [`bestEntry`](/documentation/BitcoinKernel/ChainstateManager/bestEntry),
[`blockTreeEntry(byHash:)`](/documentation/BitcoinKernel/ChainstateManager/blockTreeEntry(byHash:)), or
[`entry(atHeight:)`](/documentation/BitcoinKernel/Chain/entry(atHeight:)). Exposes height, hash, header, and walkable
parent pointer ([`previous`](/documentation/BitcoinKernel/BlockTreeEntry/previous)). Use [`contains(_:)`](/documentation/BitcoinKernel/Chain/contains(_:)) to test
whether an entry is on the active chain.

A **view type**: its lifetime is tied to the [`ChainstateManager`](/documentation/BitcoinKernel/ChainstateManager) that
produced it. Retains the manager to keep the C pointer valid; `deinit`
performs no kernel destruction. For storing entry data past the
manager’s lifetime, promote to [`BlockTreeEntrySnapshot`](/documentation/BitcoinKernel/BlockTreeEntrySnapshot).