From 468a052f629bb81d3991e904992cf19ffb3f8b53 Mon Sep 17 00:00:00 2001 From: iPLAY888 <133153661+letmehateu@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:04:24 +0300 Subject: [PATCH] Update passphrase.go --- accounts/keystore/passphrase.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accounts/keystore/passphrase.go b/accounts/keystore/passphrase.go index 4a49b41eed..2f3a5068a6 100644 --- a/accounts/keystore/passphrase.go +++ b/accounts/keystore/passphrase.go @@ -34,7 +34,6 @@ import ( "encoding/json" "fmt" "io" - "math" "os" "path/filepath" @@ -386,10 +385,11 @@ func ensureInt(x interface{}) (int, error) { case int: return v, nil case float64: - if math.IsNaN(v) || math.IsInf(v, 0) || v != math.Trunc(v) || v < 0 || v > math.MaxInt32 { + n := int(v) + if v != float64(n) || n < 0 { return 0, fmt.Errorf("invalid KDF parameter: %v", v) } - return int(v), nil + return n, nil default: return 0, fmt.Errorf("invalid KDF parameter: expected number, got %T", x) }