<!--
{
  "availability" : [

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

# BlockTreeEntrySnapshot

An owned snapshot of a [`BlockTreeEntry`](/documentation/BitcoinKernel/BlockTreeEntry)’s data — three fields
(height, block hash, block header) captured as Swift-owned values.

```
struct BlockTreeEntrySnapshot
```

## Overview

Unlike [`BlockTreeEntry`](/documentation/BitcoinKernel/BlockTreeEntry) (a view type whose pointer lifetime is tied
to [`ChainstateManager`](/documentation/BitcoinKernel/ChainstateManager)), a snapshot owns all its data and is safe to
store indefinitely, pass across tasks, and capture in closures.

Used primarily by kernel notification callbacks
([`blockTip`](/documentation/BitcoinKernel/NotificationCallbacks/blockTip),
[`blockConnected`](/documentation/BitcoinKernel/ValidationInterfaceCallbacks/blockConnected) etc.), where the
underlying C pointer is only valid during the callback invocation.
Promote any `BlockTreeEntry` to a snapshot before escaping the
callback scope.