# CompactBlockProcessor

    public class CompactBlockProcessor

The compact block processor is in charge of orchestrating the download and caching of compact blocks from a LightWalletEndpoint when started the processor downloads does a download - validate - scan cycle until it reaches latest height on the blockchain.

- `Configuration`

  Compact Block Processor configuration

  Property: cacheDbPath absolute file path of the DB where raw, unprocessed compact blocks are stored. Property: dataDbPath absolute file path of the DB where all information derived from the cache DB is stored.

  See more

  #### Declaration

  Swift

      public struct Configuration

- `State`

  Represents the possible states of a CompactBlockProcessor

  See more

  #### Declaration

  Swift

      public enum State

      extension CompactBlockProcessor.State: Equatable

- `state`

  Undocumented

  #### Declaration

  Swift

      public private(set) var state: State { get set }

- `init(initializer:)`

  Initializes a CompactBlockProcessor instance from an Initialized object

  #### Declaration

  Swift

      public convenience init(initializer: Initializer)

  #### Parameters

  `initializer` | an instance that complies to CompactBlockDownloading protocol

- `start(retry:)`

  Starts the CompactBlockProcessor instance and starts downloading and processing blocks

  triggers the blockProcessorStartedDownloading notification

  Important

  subscribe to the notifications before calling this method

  #### Declaration

  Swift

      public func start(retry: Bool = false) throws

- `stop(cancelTasks:)`

  Stops the CompactBlockProcessor

  Note: retry count is reset

  #### Declaration

  Swift

      public func stop(cancelTasks: Bool = true)

  #### Parameters

  `cancelTasks` | cancel the pending tasks. Defaults to true

- `rewindTo(_:)`

  Rewinds to provided height. If nil is provided, it will rescan to nearest height (quick rescan)

  #### Declaration

  Swift

      public func rewindTo(_ height: BlockHeight?) throws -> BlockHeight

- `utxoCacheBalance(tAddress:)`

  Undocumented

  #### Declaration

  Swift

      public func utxoCacheBalance(tAddress: String) throws -> WalletBalance

- `getUnifiedAddres(accountIndex:)`

  Undocumented

  #### Declaration

  Swift

      public func getUnifiedAddres(accountIndex: Int) -> UnifiedAddress?

- `getShieldedAddress(accountIndex:)`

  Undocumented

  #### Declaration

  Swift

      public func getShieldedAddress(accountIndex: Int) -> SaplingShieldedAddress?

- `getTransparentAddress(accountIndex:)`

  Undocumented

  #### Declaration

  Swift

      public func getTransparentAddress(accountIndex: Int) -> TransparentAddress?

- `getTransparentBalance(accountIndex:)`

  Undocumented

  #### Declaration

  Swift

      public func getTransparentBalance(accountIndex: Int) throws -> WalletBalance

© 2022 Francisco Gindre and Jack Grigg. All rights reserved. (Last updated: 2022-04-07)

Generated by jazzy ♪♫ v0.14.2, a Realm project.