packages feed

haskoin-store 0.40.13 → 0.40.14

raw patch · 2 files changed

+12/−18 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

haskoin-store.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           haskoin-store-version:        0.40.13+version:        0.40.14 synopsis:       Storage and index for Bitcoin and Bitcoin Cash description:    Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category:       Bitcoin, Finance, Network
src/Haskoin/Store/Cache.hs view
@@ -534,16 +534,12 @@     flush n =         case min 1000 (n `div` 64) of         0 -> return 0-        x -> do-            m <- withLock $ do-                ks <- fmap (map fst) . runRedis $-                      getFromSortedSet maxKey Nothing 0 (fromIntegral x)-                $(logDebugS) "Cache" $-                    "Pruning " <> cs (show (length ks)) <> " old xpubs"-                delXPubKeys ks-            case m of-                Nothing -> return 0-                Just y  -> return y+        x -> withLockForever $ do+            ks <- fmap (map fst) . runRedis $+                  getFromSortedSet maxKey Nothing 0 (fromIntegral x)+            $(logDebugS) "Cache" $+                "Pruning " <> cs (show (length ks)) <> " old xpubs"+            delXPubKeys ks  touchKeys :: MonadLoggerIO m => [XPubSpec] -> CacheX m () touchKeys xpubs = do@@ -559,12 +555,10 @@        (MonadUnliftIO m, MonadLoggerIO m, StoreReadExtra m)     => CacheWriterMessage -> CacheX m () cacheWriterReact CacheNewBlock =-    inSync >>= \s -> when s-    newBlockC-cacheWriterReact (CachePing respond) =-    inSync >>= \s -> when s $-    syncMempoolC >>-    pruneDB >>+    inSync >>= \s -> when s newBlockC+cacheWriterReact (CachePing respond) = do+    s <- inSync+    when s $ syncMempoolC >> void pruneDB     atomically (respond ())  lenNotNull :: [XPubBal] -> Int@@ -954,7 +948,7 @@              => CacheX m () syncMempoolC = do     refresh <- toInteger <$> asks cacheRefresh-    void . withLock . withCool "cool" (refresh * 9 `div` 10) $ do+    void . withLockForever . withCool "cool" (refresh * 9 `div` 10) $ do         nodepool <- HashSet.fromList . map snd <$> lift getMempool         cachepool <- HashSet.fromList . map snd <$> cacheGetMempool         getem (HashSet.difference nodepool cachepool)