<!--
{
  "availability" : [

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

# readBlockSpentOutputs(at:)

Reads the spent outputs (undo data) for a block from disk — the
collection of UTXOs that this block consumed.

```
func readBlockSpentOutputs(at entry: BlockTreeEntry) -> BlockSpentOutputs?
```

## Parameters

`entry`

The block tree entry pointing to the block.

## Return Value

The block’s spent outputs, or `nil` on read failure.

## Discussion

Spent-output data is what lets the kernel undo a block during a
reorg. Returns `nil` for the genesis block (no inputs spent, no
undo data written) and when the undo file is not present on disk.