From 088d166d13d577504dc33db9d73712a54d68a34c Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Tue, 27 Sep 2022 18:08:59 +0000 Subject: [PATCH] Fix infinite loop in getBundleR --- src/Vervis/Handler/Cloth.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Vervis/Handler/Cloth.hs b/src/Vervis/Handler/Cloth.hs index 187fc0a..621168a 100644 --- a/src/Vervis/Handler/Cloth.hs +++ b/src/Vervis/Handler/Cloth.hs @@ -437,7 +437,7 @@ getBundleR loomHash clothHash bundleHash = do bundleID <- decodeKeyHashid404 bundleHash bundle <- get404 bundleID unless (bundleTicket bundle == clothID) notFound - latest :| prevs <- + latest :| olds <- case justHere proposal of Nothing -> error "Why didn't getCloth find any bundles" Just bundles -> return bundles @@ -448,8 +448,8 @@ getBundleR loomHash clothHash bundleHash = do Just ne -> return ne let (prevs, mcurr) = if bundleID == latest - then (prevs, Nothing) - else ([] , Just latest) + then (olds, Nothing) + else ([] , Just latest) return (patches, prevs, mcurr) encodeRouteLocal <- getEncodeRouteLocal