haskoin-store 0.16.3 → 0.16.4
raw patch · 3 files changed
+15/−28 lines, 3 files
Files
- CHANGELOG.md +4/−0
- haskoin-store.cabal +2/−2
- src/Network/Haskoin/Store/Web.hs +9/−26
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.16.4+### Removed+- Remove concurrency from requests using iterators to prevent RocksDB from segfaulting.+ ## 0.16.3 ### Added - Debugging information for web API.
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 8d7ecfe8340a37feb3963de53242a033672aa794f96a5133090643117a1b8de9+-- hash: 8ab386452576005ff6acda2b569d7e1219303832c0c0271c8a43b4c32e960acc name: haskoin-store-version: 0.16.3+version: 0.16.4 synopsis: Storage and index for Bitcoin and Bitcoin Cash description: Store blocks, transactions, and balances for Bitcoin or Bitcoin Cash, and make that information via REST API. category: Bitcoin, Finance, Network
src/Network/Haskoin/Store/Web.hs view
@@ -885,23 +885,14 @@ -> XPubKey -> ConduitT () XPubUnspent m () xpubUnspent net mbr xpub = do- (_, as) <-- lift $ allocate (newTVarIO []) (readTVarIO >=> mapM_ cancel)- xs <-- lift $ do- bals <- xpubBals xpub- forM bals $ \XPubBal {xPubBalPath = p, xPubBal = b} ->- mask_ $ do- q <- newTBQueueIO 10- a <-- async . runConduit $- getAddressUnspents (balanceAddress b) mbr .| mapC (f p) .|- conduitToQueue q- atomically $ modifyTVar as (a :)- return $ queueToConduit q+ xs <- do+ bs <- lift $ xpubBals xpub+ return $ map g bs mergeSourcesBy (flip compare `on` (unspentBlock . xPubUnspent)) xs where f p t = XPubUnspent {xPubUnspentPath = p, xPubUnspent = t}+ g XPubBal {xPubBalPath = p, xPubBal = b} =+ getAddressUnspents (balanceAddress b) mbr .| mapC (f p) xpubUnspentLimit :: ( MonadResource m@@ -1062,19 +1053,11 @@ -> StartFrom -> [Address] -> ConduitT () BlockTx m ()-getAddressesTxsLimit l s addrs = do- (_, ss) <- lift $ allocate (newTVarIO []) (readTVarIO >=> mapM_ cancel)- xs <-- lift . forM addrs $ \addr ->- mask_ $ do- q <- newTBQueueIO 10- a <-- async . runConduit $- getAddressTxs addr (mbr s) .| conduitToQueue q- atomically $ modifyTVar ss (a :)- return $ queueToConduit q+getAddressesTxsLimit l s as = mergeSourcesBy (flip compare `on` blockTxBlock) xs .| dedup .|- (offset s >> limit l)+ (offset s >> limit l)+ where+ xs = map (\a -> getAddressTxs a (mbr s)) as getAddressesTxsFull :: (MonadResource m, MonadUnliftIO m, StoreStream m, StoreRead m)