haskoin-node 1.4.3 → 1.4.4
raw patch · 5 files changed
+31/−13 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +14/−0
- haskoin-node.cabal +1/−1
- src/Haskoin/Node/Chain.hs +9/−7
- src/Haskoin/Node/Peer.hs +2/−1
- src/Haskoin/Node/PeerMgr.hs +5/−4
CHANGELOG.md view
@@ -4,6 +4,20 @@ 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). +## [1.4.4] - 2026-08-31++### Added++- Log `connectBlocks` error message.++### Changed++- Peer connection logged incorrectly as warn is now logged as info.++### Fixed++- Correct documentation for `importHeaders` function.+ ## [1.4.3] - 2026-08-13 ### Fixed
haskoin-node.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: haskoin-node-version: 1.4.3+version: 1.4.4 synopsis: P2P library for Bitcoin and Bitcoin Cash description: Please see the README on GitHub at <https://github.com/jprupp/haskoin-node#readme> category: Bitcoin, Finance, Network
src/Haskoin/Node/Chain.hs view
@@ -378,20 +378,22 @@ _ -> return [] -- | Import a bunch of continuous headers. Returns 'True' if the number of--- headers is 2000, which means that there are possibly more headers to sync--- from whatever peer delivered these.+-- headers is less than 2000, which means that there are no more headers to sync+-- from the peer that delivered these. importHeaders ::- (MonadIO m) => Chain -> UTCTime -> [BlockHeader] -> m (Maybe Bool)+ (MonadLoggerIO m) => Chain -> UTCTime -> [BlockHeader] -> m (Maybe Bool) importHeaders ch now hs = connect >>= \case- Left _ -> return Nothing- Right _- | null hs -> return (Just False)+ Left e -> do+ $(logErrorS) "Chain" ("connectBlocks: " <> cs e)+ return Nothing+ Right bns+ | null bns -> return (Just False) | otherwise -> do bb <- get_last atomically . modifyTVar ch.state $ \s -> s {syncing = set_best bb <$> s.syncing}- return (Just (length hs < 2000))+ return (Just (length bns < 2000)) where set_best bb ChainSync {..} = ChainSync {best = bb, ..} timestamp = floor (utcTimeToPOSIXSeconds now)
src/Haskoin/Node/Peer.hs view
@@ -148,7 +148,8 @@ return False -- | Internal conduit to parse messages coming from peer.-inPeerConduit :: (MonadLoggerIO m) => PeerConfig -> ConduitT ByteString Message m ()+inPeerConduit ::+ (MonadLoggerIO m) => PeerConfig -> ConduitT ByteString Message m () inPeerConduit pc@PeerConfig {label, net} = forever $ do $(logDebugS) "Peer" (label <> " awaiting message...") x <- takeCE 24 .| foldC
src/Haskoin/Node/PeerMgr.hs view
@@ -270,14 +270,15 @@ let deadline = mgr.config.timeout `addUTCTime` o.tickled if | now > expired -> do- $(logWarnS) "PeerMgr" ("Peer " <> p.label <> " is too old")+ $(logErrorS) "PeerMgr" ("Peer " <> p.label <> " is too old") killPeer p | now > deadline -> do- $(logWarnS) "PeerMgr" ("Peer " <> p.label <> " timed out")+ $(logErrorS) "PeerMgr" ("Peer " <> p.label <> " timed out") killPeer p | isNothing o.ping -> sendPing mgr p | otherwise -> return ()- _ -> return ()+ Nothing -> do+ $(logErrorS) "PeerMgr" ("Peer " <> p.label <> " is offline") sendPing :: (MonadLoggerIO m) => PeerMgr -> Peer -> m () sendPing mgr p = do@@ -346,7 +347,7 @@ Just _ -> $(logWarnS) "PeerMgr" ("Duplicate connection to peer " <> cs (show sa)) Nothing -> do- $(logWarnS) "PeerMgr" ("Connecting to peer " <> cs (show sa))+ $(logInfoS) "PeerMgr" ("Connecting to peer " <> cs (show sa)) nonce <- randomIO bb <- getBestBlock mgr now <- liftIO getCurrentTime