haskoin-node 0.17.13 → 0.17.14
raw patch · 3 files changed
+14/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Haskoin.Node: EmptyHeader :: PeerException
Files
- CHANGELOG.md +5/−0
- haskoin-node.cabal +2/−2
- src/Haskoin/Node/Peer.hs +7/−4
CHANGELOG.md view
@@ -4,6 +4,11 @@ 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.17.4+### Fixed+- Reduce verbosity on incoming header decode test.+- Show appropriate error message upon receiving empty headers.+ ## 0.17.13 ### Added - Display more details about invalid incoming headers.
haskoin-node.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: c1a4396b3f82b4a278470d6085ab2c65b132c37bfc67dca1c21dfe8277bf0775+-- hash: 5d100416eb908a4c0c3c591ab5da8a5d02f56be464f1e8fe78672e19289ffdd6 name: haskoin-node-version: 0.17.13+version: 0.17.14 synopsis: P2P library for Bitcoin and Bitcoin Cash description: Please see the README on GitHub at <https://github.com/haskoin/haskoin-node#readme> category: Bitcoin, Finance, Network
src/Haskoin/Node/Peer.hs view
@@ -92,6 +92,7 @@ | PeerTimeout | UnknownPeer | PeerTooOld+ | EmptyHeader deriving Eq instance Show PeerException where@@ -109,6 +110,7 @@ show PeerTimeout = "Peer timed out" show UnknownPeer = "Unknown peer" show PeerTooOld = "Peer too old"+ show EmptyHeader = "Empty header" instance Exception PeerException @@ -184,13 +186,14 @@ inPeerConduit net a = forever $ do x <- takeCE 24 .| foldC+ when (B.null x) $ do+ $(logErrorS) (peerLog a) $ "Peer sent empty header"+ throwIO EmptyHeader case decode x of Left e -> do $(logErrorS) (peerLog a) $- "Could not decode message header: " <>- encodeHex x- $(logErrorS) (peerLog a) $- "Error: " <> cs e+ "Could not decode message header: \"" <>+ encodeHex x <> "\"" throwIO DecodeHeaderError Right (MessageHeader _ cmd len _) -> do when (len > 32 * 2 ^ (20 :: Int)) $ do