diff --git a/TangemSdk/TangemSdk/Operations/Derivation/DeriveWalletPublicKeysTask.swift b/TangemSdk/TangemSdk/Operations/Derivation/DeriveWalletPublicKeysTask.swift index 7168b1cac..76f2b963e 100644 --- a/TangemSdk/TangemSdk/Operations/Derivation/DeriveWalletPublicKeysTask.swift +++ b/TangemSdk/TangemSdk/Operations/Derivation/DeriveWalletPublicKeysTask.swift @@ -39,14 +39,22 @@ public class DeriveWalletPublicKeysTask: CardSessionRunnable { let path = derivationPaths[index] let task = DeriveWalletPublicKeyTask(walletPublicKey: walletPublicKey, derivationPath: path) task.run(in: session) { result in + var keys = keys + switch result { case .success(let key): - var keys = keys keys[path] = key - self.runDerivation(at: index + 1, keys: keys, in: session, completion: completion) case .failure(let error): - completion(.failure(error)) + switch error { + case .nonHardenedDerivationNotSupported, .walletNotFound, .unsupportedCurve: + Log.error(error) + default: + completion(.failure(error)) + return + } } + + self.runDerivation(at: index + 1, keys: keys, in: session, completion: completion) } } }