rec :: HostName -> PortNumber -> Socket -> Socket -> SockAddr
    -> HandleConsensusMessage
    -> (BlockData -> IO ())
    -> (Block -> IO (Maybe String))
    -> IO ()
rec host port recSock sendSock sendAddr handleConsensusMessage sendToConsensusNodes isValid = do
  infoN host port "rec: waiting"
  (msg,addr) <- N.recvFrom recSock 1024
  infoN host port  ("rec: from: " <> show addr <> " " <> show msg)
  handleConsensusMessage host port sendToConsensusNodes isValid msg
  rec host port recSock sendSock sendAddr handleConsensusMessage sendToConsensusNodes isValid

-- Read from sendToConsensusNodes and broadcast
rec :: HostName -> PortNumber -> Socket -> Socket -> SockAddr
    -> HandleConsensusMessage
    -> (BlockData -> IO ())
    -> (Block -> IO (Maybe String))
    -> IO ()
rec host port recSock sendSock sendAddr handleConsensusMessage sendToConsensusNodes isValid = do
  infoN host port "rec: waiting"
  (msg,addr) <- N.recvFrom recSock 1024
  infoN host port  ("rec: from: " <> show addr <> " " <> show msg)
  handleConsensusMessage host port sendToConsensusNodes isValid msg
  rec host port recSock sendSock sendAddr handleConsensusMessage sendToConsensusNodes isValid

-- Read from sendToConsensusNodes and broadcast
rec host port recSock sendSock sendAddr handleConsensusMessage sendToConsensusNodes isValid = do
  infoN host port "rec: waiting"
  (msg,addr) <- N.recvFrom recSock 1024
  infoN host port  ("rec: from: " <> show addr <> " " <> show msg)
  handleConsensusMessage host port sendToConsensusNodes isValid msg
  rec host port recSock sendSock sendAddr handleConsensusMessage sendToConsensusNodes isValid

-- Read from sendToConsensusNodes and broadcast