From 28a75895f47e980481557890115c337e05901eac Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Fri, 25 Oct 2024 12:36:24 -0500 Subject: [PATCH] fix: correct commitment tree function --- src/Zenith/Core.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Zenith/Core.hs b/src/Zenith/Core.hs index 2dd74f2..45422ee 100644 --- a/src/Zenith/Core.hs +++ b/src/Zenith/Core.hs @@ -125,7 +125,16 @@ getCommitmentTrees :: getCommitmentTrees pool nodeHost nodePort znet block = do bh' <- getBlockHash pool block znet case bh' of - Nothing -> throwIO $ userError "couldn't get block hash" + Nothing -> do + r <- + makeZebraCall + nodeHost + nodePort + "z_gettreestate" + [Data.Aeson.String $ T.pack $ show block] + case r of + Left e -> throwIO $ userError e + Right zti -> return zti Just bh -> do r <- makeZebraCall