haskoin-store 0.23.18 → 0.23.19
raw patch · 4 files changed
+12/−3 lines, 4 files
Files
- CHANGELOG.md +4/−0
- haskoin-store.cabal +2/−2
- src/Haskoin/Store/BlockStore.hs +5/−1
- src/Haskoin/Store/Manager.hs +1/−0
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.23.19+### Changed+- Use set peer timeout instead of constant in block store. + ## 0.23.18 ### Changed - Allow setting peer timeouts in command line.
haskoin-store.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 7cb9ca2addafaf28c129fa7c583ec3acf75012c194b9ff977699dfab0ac3c672+-- hash: be4475f39ee933c10fae43c889f358b857889d044806b83028e889fd37c8c6af name: haskoin-store-version: 0.23.18+version: 0.23.19 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
@@ -113,6 +113,9 @@ , blockConfNet :: !Network -- ^ network constants , blockConfWipeMempool :: !Bool+ -- ^ wipe mempool at start+ , blockConfPeerTimeout :: !Int+ -- ^ disconnect syncing peer if inactive for this long } type BlockT m = ReaderT BlockRead m@@ -490,7 +493,8 @@ Nothing -> return () Just Syncing {syncingTime = t, syncingPeer = p} -> do n <- fromIntegral . systemSeconds <$> liftIO getSystemTime- when (n > t + 60) $ do+ peertout <- asks (blockConfPeerTimeout . myConfig)+ when (n > t + fromIntegral peertout) $ do p' <- managerPeerText p =<< asks (blockConfManager . myConfig) $(logErrorS) "BlockStore" $ "Timeout syncing peer " <> p' resetPeer
src/Haskoin/Store/Manager.hs view
@@ -149,6 +149,7 @@ , blockConfDB = db , blockConfNet = storeConfNetwork cfg , blockConfWipeMempool = storeConfWipeMempool cfg+ , blockConfPeerTimeout = storeConfPeerTimeout cfg } runaction = action