From d2dcddbeb260bb2c2586add9de6b2eeb7aedfda2 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Sat, 8 Oct 2022 07:16:47 -0500 Subject: [PATCH] Viewing key process enhancements --- src/ZGoBackend.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ZGoBackend.hs b/src/ZGoBackend.hs index 4cacce7..3c55d77 100644 --- a/src/ZGoBackend.hs +++ b/src/ZGoBackend.hs @@ -692,12 +692,12 @@ routes pipe config = do post "/api/owner" $ do o <- jsonData let q = payload (o :: Payload Owner) - known <- liftAndCatchIO $ listAddresses nodeUser nodePwd if not (opayconf q) then do _ <- liftAndCatchIO $ run (upsertOwner q) status created201 else do + known <- liftAndCatchIO $ listAddresses nodeUser nodePwd if oaddress q `elem` map addy known then do _ <- liftAndCatchIO $ run (upsertOwner q) @@ -708,7 +708,7 @@ routes pipe config = do nodeUser nodePwd "z_importviewingkey" - [Data.Aeson.String (oviewkey q), "no"] + [Data.Aeson.String (T.strip (oviewkey q)), "no"] let content = getResponseBody vkInfo :: RpcResponse Object if isNothing (err content) then do