packages feed

haskoin-node 0.4.1 → 0.4.2

raw patch · 3 files changed

+12/−8 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

Network/Haskoin/Node/BlockChain.hs view
@@ -4,7 +4,7 @@  import           Control.Concurrent              (threadDelay) import           Control.Concurrent.Async.Lifted (link, mapConcurrently,-                                                  waitAny, withAsync)+                                                  waitAnyCancel, withAsync) import           Control.Concurrent.STM          (STM, atomically, isEmptyTMVar,                                                   putTMVar, readTVar, retry,                                                   takeTMVar, tryReadTMVar,@@ -57,8 +57,9 @@         $(logInfo) "Initial header sync complete"         $(logDebug) "Starting the tickle processing thread"         withAsync processTickles $ \a2 -> link a2 >> do-            _ <- liftIO $ waitAny [a1, a2]+            _ <- liftIO $ waitAnyCancel [a1, a2]             return ()+        $(logDebug) "Exiting SPV-node thread"  -- Source of all transaction broadcasts txSource :: (MonadLoggerIO m, MonadBaseControl IO m)@@ -177,7 +178,7 @@             (waitVal valE >> return (Right valE))         case resE of             Left newValE -> waitRescan rescanTMVar newValE-            Right res -> return res+            Right res    -> return res     waitVal valE = case valE of         Left ts -> waitFastCatchup ts         Right h -> waitHeight h@@ -473,7 +474,7 @@     -- Then we re-evaluate the best peer     continue <- catchAny (peerHeaderSyncLimit pid peerSessionHost 10) $         \e -> do-            $(logError) $ pack $ show e+            $(logError) $ pack $ unwords ["peerHeaderSyncLimit:", show e]             disconnectPeer pid peerSessionHost >> return True      -- Reset the header syncing peer
Network/Haskoin/Node/Peer.hs view
@@ -11,6 +11,7 @@                                                   swapTVar) import           Control.Concurrent.STM.TBMChan  (TBMChan, closeTBMChan,                                                   newTBMChan, writeTBMChan)+import           Control.Exception               (AsyncException(ThreadKilled)) import           Control.Exception.Lifted        (finally, fromException, throw,                                                   throwIO) import           Control.Monad                   (forM_, forever, join, unless,@@ -90,9 +91,10 @@                 $(logError) $ formatPid pid ph $ unwords                     [ "Peer thread stopped with exception:", show se ]                 return $ case fromException se of-                    Just NodeExceptionBanned    -> False-                    Just NodeExceptionConnected -> False-                    _ -> True+                    Just  NodeExceptionBanned         -> False+                    Just  NodeExceptionConnected      -> False+                    Just (NodeExceptionInvalidPeer _) -> False+                    _ -> fromException se /= Just ThreadKilled             Right _ -> do                 $(logDebug) $ formatPid pid ph "Peer thread stopped"                 return True@@ -200,6 +202,7 @@                         withAsync (peerPing pid ph) $ \a3 -> link a3 >> do                             $(logDebug) $ formatPid pid ph "Ping thread started"                             _ <- liftIO $ waitAnyCancel [a1, a2, a3]+                            $(logDebug) $ formatPid pid ph "Exiting peer TCP thread"                             return ()      cleanupPeer = do
haskoin-node.cabal view
@@ -1,5 +1,5 @@ name:                  haskoin-node-version:               0.4.1+version:               0.4.2 synopsis:     Implementation of a Bitoin node. description: