From cf478af971ecdeb157cdcd4274fc79fb2a949afd Mon Sep 17 00:00:00 2001
From: Jeromy <jeromyj@gmail.com>
Date: Wed, 22 Apr 2015 01:25:22 -0700
Subject: [PATCH] cleanup changes from PR

---
 core/core.go          | 7 ++++---
 p2p/discovery/mdns.go | 6 ------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/core/core.go b/core/core.go
index 25ca7a04e..7eb479f27 100644
--- a/core/core.go
+++ b/core/core.go
@@ -268,10 +268,11 @@ func (n *IpfsNode) startOnlineServices(ctx context.Context, routingOption Routin
 	if do != nil {
 		service, err := do(n.PeerHost)
 		if err != nil {
-			return err
+			log.Error("mdns error: ", err)
+		} else {
+			service.RegisterNotifee(n)
+			n.Discovery = service
 		}
-		service.RegisterNotifee(n)
-		n.Discovery = service
 	}
 
 	return n.Bootstrap(DefaultBootstrapConfig)
diff --git a/p2p/discovery/mdns.go b/p2p/discovery/mdns.go
index 234ef5f6b..1abd3bd27 100644
--- a/p2p/discovery/mdns.go
+++ b/p2p/discovery/mdns.go
@@ -2,13 +2,10 @@ package discovery
 
 import (
 	"errors"
-	"fmt"
 	"io"
 	"io/ioutil"
 	golog "log"
 	"net"
-	//"strconv"
-	//"strings"
 	"sync"
 	"time"
 
@@ -75,8 +72,6 @@ func NewMdnsService(peerhost host.Host, interval time.Duration) (Service, error)
 		port = addr.Port
 	}
 
-	fmt.Println("using port: ", port)
-
 	myid := peerhost.ID().Pretty()
 
 	info := []string{myid}
@@ -135,7 +130,6 @@ func (m *mdnsService) pollForEntries() {
 }
 
 func (m *mdnsService) handleEntry(e *mdns.ServiceEntry) {
-	fmt.Println("handling entry!")
 	mpeer, err := peer.IDB58Decode(e.Info)
 	if err != nil {
 		log.Warning("Error parsing peer ID from mdns entry: ", err)
-- 
GitLab