haskoin-store 0.14.0 → 0.14.1
raw patch · 3 files changed
+26/−8 lines, 3 files
Files
- CHANGELOG.md +7/−0
- haskoin-store.cabal +2/−2
- src/Network/Haskoin/Store/Block.hs +17/−6
CHANGELOG.md view
@@ -4,6 +4,13 @@ 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.14.1+### Added+- Extra debugging around code that freezes.++### Changed+- Bump dependency on `haskoin-node`.+ ## 0.14.0 ### Removed - Dump slow protobuf serialization.
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 73e4ade5ce40c1a0dd2274fe3a2072c7dd75edd5c9ce325cd27f67b5966d7069+-- hash: 8f1ba25105410baa714dfab266a240edee9db75acaf255263585ba43efbce9be name: haskoin-store-version: 0.14.0+version: 0.14.1 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/Block.hs view
@@ -92,15 +92,26 @@ $(logDebugS) "Block" "Awaiting message..." receive inbox >>= processBlockMessage -isSynced :: (MonadUnliftIO m) => ReaderT BlockRead m Bool+isSynced :: (MonadLoggerIO m, MonadUnliftIO m) => ReaderT BlockRead m Bool isSynced = do (db, ch) <- (blockConfDB &&& blockConfChain) <$> asks myConfig+ $(logDebugS) "Block" "Testing if synced with header chain..." withBlockDB defaultReadOptions db $ getBestBlock >>= \case- Nothing -> throwIO Uninitialized- Just bb ->- chainGetBest ch >>= \cb ->- return (headerHash (nodeHeader cb) == bb)+ Nothing -> do+ $(logErrorS) "Block" "Block database uninitialized"+ throwIO Uninitialized+ Just bb -> do+ $(logDebugS) "Block" $ "Best block: " <> blockHashToHex bb+ chainGetBest ch >>= \cb -> do+ $(logDebugS) "Block" $+ "Best chain block " <>+ blockHashToHex (headerHash (nodeHeader cb)) <>+ " at height " <>+ cs (show (nodeHeight cb))+ let s = headerHash (nodeHeader cb) == bb+ $(logDebugS) "Block" $ "Synced: " <> cs (show s)+ return s mempool :: (MonadUnliftIO m, MonadLoggerIO m) => Peer -> ReaderT BlockRead m ()@@ -230,7 +241,7 @@ atomically $ l (StoreMempoolNew (txHash tx)) Right False -> $(logDebugS) "Block" $- "Received invalid mempool tx: " <> txHashToHex (txHash tx)+ "Not importing mempool tx: " <> txHashToHex (txHash tx) processTxs :: (MonadUnliftIO m, MonadLoggerIO m)