zcash-android-wallet-sdk/docs/-sdk-synchronizer/validate-consensus-branch.md

1.0 KiB

zcash-android-wallet-sdk / cash.z.ecc.android.sdk / SdkSynchronizer / validateConsensusBranch

validateConsensusBranch

suspend fun validateConsensusBranch(): ConsensusMatchType

Validate whether the server and this SDK share the same consensus branch. This is particularly important to check around network updates so that any wallet that's connected to an incompatible server can surface that information effectively. For the SDK, the consensus branch is used when creating transactions as each one needs to target a specific branch. This function compares the server's branch id to this SDK's and returns information that helps determine whether they match.

Return an instance of ConsensusMatchType that is essentially a wrapper for both branch ids and provides helper functions for communicating detailed errors to the user.