haskoin-node-0.4.1: Implementation of a Bitoin node.

Safe HaskellNone
LanguageHaskell98

Network.Haskoin.Node.Peer

Synopsis

Documentation

decodeMessage :: (MonadLoggerIO m, MonadBaseControl IO m) => PeerId -> PeerHost -> Sink ByteString (StateT (Maybe (MerkleBlock, MerkleTxs)) (NodeT m)) () Source #

Decode messages sent from the remote host and send them to the peers main message queue for processing. If we receive invalid messages, this function will also notify the PeerManager about a misbehaving remote host.

encodeMessage :: MonadLoggerIO m => Conduit Message (NodeT m) ByteString Source #

Encode message that are being sent to the remote host.

raceTimeout Source #

Arguments

:: (MonadIO m, MonadBaseControl IO m) 
=> Int

Timeout value in seconds

-> m a

Action to run if the main action times out

-> m b

Action to run until the time runs out

-> m (Either a b)