haskoin-store 0.23.8 → 0.23.9
raw patch · 3 files changed
+20/−12 lines, 3 files
Files
- CHANGELOG.md +4/−0
- haskoin-store.cabal +2/−2
- src/Haskoin/Store/BlockStore.hs +14/−10
CHANGELOG.md view
@@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## 0.23.8+### Fixed+- Wiping mempool fixed.++## 0.23.8 ### Added - Chunk transactions to be deleted from mempool.
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 23077ea7f62cd0d7cf032a9489ecf080a1abe3fcd90e3aaf166fb2b5b40ed108+-- hash: f2fa672182f2f4eca9e4e8aba0fd7f37f495eb8a8693fa00d5393b376f155502 name: haskoin-store-version: 0.23.8+version: 0.23.9 synopsis: Storage and index for Bitcoin and Bitcoin Cash description: Store and index Bitcoin or Bitcoin Cash blocks, transactions, balances and unspent outputs. All data is available via REST API in JSON or binary format.
src/Haskoin/Store/BlockStore.hs view
@@ -166,16 +166,20 @@ deleteTx True (blockTxHash tx) wipe | blockConfWipeMempool cfg = do- take 1000 <$> getMempool >>= \case- [] -> return ()- txs ->- runImport (del txs) >>= \case- Left e -> do- $(logErrorS) "BlockStore" $- "Could not delete mempool, database corrupt: " <>- cs (show e)- throwIO CorruptDatabase- Right _ -> return ()+ mem <- getMempool+ let go txs = do+ let (txs1, txs2) = splitAt 1000 txs+ case txs1 of+ [] -> return ()+ _ ->+ runImport (del txs1) >>= \case+ Left e -> do+ $(logErrorS) "BlockStore" $+ "Could not delete mempool, database corrupt: " <>+ cs (show e)+ throwIO CorruptDatabase+ Right _ -> go txs2+ go mem | otherwise = return () ini = do runImport initBest >>= \case