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.

  • 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
  • Represents the possible states of a CompactBlockProcessor

    See more

    Declaration

    Swift

    public enum State
    extension CompactBlockProcessor.State: Equatable
  • Undocumented

    Declaration

    Swift

    public private(set) var state: State { get set }
  • Initializes a CompactBlockProcessor instance from an Initialized object

    Declaration

    Swift

    public convenience init(initializer: Initializer)

    Parameters

    initializer

    an instance that complies to CompactBlockDownloading protocol

  • 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
  • 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

  • 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
  • Undocumented

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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

    Declaration

    Swift

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