Revert "Remove unused function `ofLatestCheckpoint` from BlockHeight"

addresses PR comment from @daira

This reverts commit d0e154ded7, since it
modifies a public API and it was not the goal of this PR.
This commit is contained in:
Francisco Gindre 2023-10-31 13:26:58 -03:00
parent 6bf8dc7e55
commit d2016ccd24
No known key found for this signature in database
GPG Key ID: 6B61CD8DAA2862B4
1 changed files with 10 additions and 0 deletions

View File

@ -84,3 +84,13 @@ extension Checkpoint: Decodable {
return ret
}
}
public extension BlockHeight {
/// Useful when creating a new wallet to reduce sync times.
/// - Parameters:
/// - zcashNetwork: Network to use for the block height.
/// - Returns: The block height of the newest checkpoint known by the SDK.
static func ofLatestCheckpoint(network: ZcashNetwork) -> BlockHeight {
Checkpoint.birthday(with: BlockHeight.max, network: network).height
}
}