<!--
{
  "availability" : [

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

# BlockchainSync.Updates

A single-consumer `AsyncSequence` of [`BlockchainSync.Update`](/documentation/BitcoinKernel/BlockchainSync/Update) values emitted as
the sync engine drives the chainstate forward.

```
struct Updates
```

## Overview

Backed by an [`AsyncStream`](https://developer.apple.com/documentation/swift/asyncstream)
with `.bufferingNewest(64)` — under a slow consumer, mid-sync updates
may be dropped, but the initial [`BlockchainSync.Update.State.preparing`](/documentation/BitcoinKernel/BlockchainSync/Update/State-swift.enum/preparing)
and the terminal [`BlockchainSync.Update.State.finished`](/documentation/BitcoinKernel/BlockchainSync/Update/State-swift.enum/finished) /
[`BlockchainSync.Update.State.failed(_:)`](/documentation/BitcoinKernel/BlockchainSync/Update/State-swift.enum/failed(_:)) are always delivered.

> Note: Iterating the same `Updates` value twice starts an independent
> sync run on each iteration. That’s rarely what you want; store a
> single `Updates` value and iterate it once.