Package 

Interface CloseableSynchronizer

    • Method Detail

      • getNetwork

         abstract ZcashNetwork getNetwork()

        The network to which this synchronizer is connected and from which it is processing blocks.

      • getStatus

         abstract Flow<Synchronizer.Status> getStatus()

        A flow of values representing the Status of this Synchronizer. As the status changes, a new value will be emitted by this flow.

      • getProgress

         abstract Flow<PercentDecimal> getProgress()

        A flow of progress values, typically corresponding to this Synchronizer downloading blocks. Typically, any non-zero value below PercentDecimal.ONE_HUNDRED_PERCENT indicates that progress indicators can be shown and a value of PercentDecimal.ONE_HUNDRED_PERCENT signals that progress is complete and any progress indicators can be hidden.

      • getProcessorInfo

         abstract Flow<CompactBlockProcessor.ProcessorInfo> getProcessorInfo()

        A flow of processor details, updated every time blocks are processed to include the latest block height, blocks downloaded and blocks scanned. Similar to the progress flow but with a lot more detail.

      • getNetworkHeight

         abstract StateFlow<BlockHeight> getNetworkHeight()

        The latest height observed on the network, which does not necessarily correspond to the latest downloaded height or scanned height. Although this is present in processorInfo, it is such a frequently used value that it is convenient to have the real-time value by itself.

      • getLatestBirthdayHeight

         abstract BlockHeight getLatestBirthdayHeight()

        An in-memory reference to the best known birthday height, which can change if the first transaction has not yet occurred.

      • getOnProcessorErrorHandler

         abstract Function1<Throwable, Boolean> getOnProcessorErrorHandler()

        An error handler for exceptions during processing. For instance, a block might be missing or a reorg may get mishandled or the database may get corrupted.

      • setOnProcessorErrorHandler

         abstract Unit setOnProcessorErrorHandler(Function1<Throwable, Boolean> onProcessorErrorHandler)

        An error handler for exceptions during processing. For instance, a block might be missing or a reorg may get mishandled or the database may get corrupted.

      • getOnSubmissionErrorHandler

         abstract Function1<Throwable, Boolean> getOnSubmissionErrorHandler()

        An error handler for exceptions while submitting transactions to lightwalletd. For instance, a transaction may get rejected because it would be a double-spend or the user might lose their cellphone signal.

      • setOnSubmissionErrorHandler

         abstract Unit setOnSubmissionErrorHandler(Function1<Throwable, Boolean> onSubmissionErrorHandler)

        An error handler for exceptions while submitting transactions to lightwalletd. For instance, a transaction may get rejected because it would be a double-spend or the user might lose their cellphone signal.

      • getOnSetupErrorHandler

         abstract Function1<Throwable, Boolean> getOnSetupErrorHandler()

        Callback for setup errors that occur prior to processing compact blocks. Can be used to override any errors encountered during setup. When this listener is missing then all setup errors will result in the synchronizer not starting. This is particularly useful for wallets to receive a callback right before the SDK will reject a lightwalletd server because it appears not to match.

      • setOnSetupErrorHandler

         abstract Unit setOnSetupErrorHandler(Function1<Throwable, Boolean> onSetupErrorHandler)

        Callback for setup errors that occur prior to processing compact blocks. Can be used to override any errors encountered during setup. When this listener is missing then all setup errors will result in the synchronizer not starting. This is particularly useful for wallets to receive a callback right before the SDK will reject a lightwalletd server because it appears not to match.

      • getOnChainErrorHandler

         abstract Function2<BlockHeight, BlockHeight, Object> getOnChainErrorHandler()

        A callback to invoke whenever a chain error is encountered. These occur whenever the processor detects a missing or non-chain-sequential block (i.e. a reorg). At a minimum, it is best to log these errors because they are the most common source of bugs and unexpected behavior in wallets, due to the chain data mutating and wallets becoming out of sync.

      • setOnChainErrorHandler

         abstract Unit setOnChainErrorHandler(Function2<BlockHeight, BlockHeight, Object> onChainErrorHandler)

        A callback to invoke whenever a chain error is encountered. These occur whenever the processor detects a missing or non-chain-sequential block (i.e. a reorg). At a minimum, it is best to log these errors because they are the most common source of bugs and unexpected behavior in wallets, due to the chain data mutating and wallets becoming out of sync.