packages feed

haskoin-store 0.64.5 → 0.64.6

raw patch · 4 files changed

+26/−22 lines, 4 filesdep ~haskoin-store-dataPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: haskoin-store-data

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) +## 0.64.6+### Fixed+- Record cache index time just once per xpub.+ ## 0.64.5 ### Changed - Add suffix cached to cache entries to avoid conflicts with data entries.
README.md view
@@ -35,6 +35,16 @@ ~/.local/bin/haskoin-store --help ``` +## Install on Fedora++```sh+dnf install git zlib-devel libsecp256k1-devel rocksdb-devel stack+git clone https://github.com/haskoin/haskoin-store.git+cd haskoin-store+stack build --copy-bins+~/.local/bin/haskoin-store --help+```+ ## Non-Haskell Dependencies  * [zlib](https://zlib.net/)
haskoin-store.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           haskoin-store-version:        0.64.5+version:        0.64.6 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@@ -60,7 +60,7 @@     , hashable >=1.3.0.0     , haskoin-core >=0.21.1     , haskoin-node >=0.17.0-    , haskoin-store-data ==0.64.5+    , haskoin-store-data ==0.64.6     , hedis >=0.12.13     , http-types >=0.12.3     , lens >=4.18.1@@ -116,7 +116,7 @@     , haskoin-core >=0.21.1     , haskoin-node >=0.17.0     , haskoin-store-    , haskoin-store-data ==0.64.5+    , haskoin-store-data ==0.64.6     , hedis >=0.12.13     , http-types >=0.12.3     , lens >=4.18.1@@ -177,7 +177,7 @@     , haskoin-core >=0.21.1     , haskoin-node >=0.17.0     , haskoin-store-    , haskoin-store-data ==0.64.5+    , haskoin-store-data ==0.64.6     , hedis >=0.12.13     , hspec >=2.7.1     , http-types >=0.12.3
src/Haskoin/Store/Cache.hs view
@@ -31,15 +31,7 @@ ) where  import Control.DeepSeq (NFData)-import Control.Monad (-    forM,-    forM_,-    forever,-    guard,-    unless,-    void,-    when,- )+import Control.Monad (forM, forM_, forever, guard, unless, void, when, (>=>)) import Control.Monad.Logger (     MonadLoggerIO,     logDebugS,@@ -883,15 +875,8 @@     [XPubBal] ->     CacheX m () newXPubC xpub xbals =-    should_index >>= \i ->-        when i $ withMetrics cacheIndexTime index-  where-    op XPubUnspent{xPubUnspent = u} = (unspentPoint u, unspentBlock u)-    should_index =-        asks cacheMin >>= \x ->-            if x <= lenNotNull xbals then inSync else return False-    index =-        bracket set_index unset_index $ \y -> when y $+    should_index >>= \i -> when i $+        bracket set_index unset_index $ \j -> when j $             withMetrics cacheIndexTime $ do                 xpubtxt <- xpubText xpub                 $(logDebugS) "Cache" $@@ -916,6 +901,11 @@                     e <- redisAddXPubTxs xpub xtxs                     return $ b >> c >> d >> e >> return ()                 $(logDebugS) "Cache" $ "Cached " <> xpubtxt+  where+    op XPubUnspent{xPubUnspent = u} = (unspentPoint u, unspentBlock u)+    should_index =+        asks cacheMin >>= \x ->+            if x <= lenNotNull xbals then inSync else return False     key = idxPfx <> encode xpub     opts =         Redis.SetOpts