From 66c0425bd39651eafd79901bf6639be705a09caf Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Tue, 8 Oct 2024 08:11:29 -0600 Subject: [PATCH] Ensure that scan progress can't exceed 100% --- Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift index 4d409e41..8049ee4d 100644 --- a/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift +++ b/Sources/ZcashLightClientKit/Rust/ZcashRustBackend.swift @@ -1027,7 +1027,7 @@ extension FfiScanProgress { /// Converts an [`FfiScanProgress`] into a [`ScanProgress`]. func toScanProgress() -> ScanProgress { .init( - numerator: self.numerator, + numerator: min(self.numerator, self.denominator), denominator: self.denominator ) }