diff --git a/CHANGELOG.md b/CHANGELOG.md index 80fe7a03..0d1e5db6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased +## Fixed +- Synchronizer's' `prepare()` method passes even if server is down and not providing chan tip. + # 2.1.8 - 2024-05-30 ## Added diff --git a/Sources/ZcashLightClientKit/Initializer.swift b/Sources/ZcashLightClientKit/Initializer.swift index d8af044b..51b62f45 100644 --- a/Sources/ZcashLightClientKit/Initializer.swift +++ b/Sources/ZcashLightClientKit/Initializer.swift @@ -415,8 +415,8 @@ public class Initializer { if let seed, try await rustBackend.listAccounts().isEmpty { var chainTip: UInt32? - if walletMode == .restoreWallet { - chainTip = UInt32(try await lightWalletService.latestBlockHeight()) + if walletMode == .restoreWallet, let latestBlockHeight = try? await lightWalletService.latestBlockHeight() { + chainTip = UInt32(latestBlockHeight) } _ = try await rustBackend.createAccount(