Commit 7702e9b8 authored by Aviv Eyal's avatar Aviv Eyal Committed by Steven Allen
Browse files

Minor code cleanup

parent 49182bcf
...@@ -50,8 +50,6 @@ func (e *EchoProtocol) onEchoRequest(s inet.Stream) { ...@@ -50,8 +50,6 @@ func (e *EchoProtocol) onEchoRequest(s inet.Stream) {
if !valid { if !valid {
log.Println("Failed to authenticate message") log.Println("Failed to authenticate message")
return return
} else {
//log.Println("Authenticated request content was generated by author node :-)")
} }
log.Printf("%s: Sending echo response to %s. Message id: %s...", s.Conn().LocalPeer(), s.Conn().RemotePeer(), data.MessageData.Id) log.Printf("%s: Sending echo response to %s. Message id: %s...", s.Conn().LocalPeer(), s.Conn().RemotePeer(), data.MessageData.Id)
...@@ -100,8 +98,6 @@ func (e *EchoProtocol) onEchoResponse(s inet.Stream) { ...@@ -100,8 +98,6 @@ func (e *EchoProtocol) onEchoResponse(s inet.Stream) {
if !valid { if !valid {
log.Println("Failed to authenticate message") log.Println("Failed to authenticate message")
return return
} else {
//log.Println("Authenticated response content generated by claimed node :-)")
} }
// locate request data and remove it if found // locate request data and remove it if found
......
...@@ -27,8 +27,6 @@ func makeRandomNode(port int, done chan bool) *Node { ...@@ -27,8 +27,6 @@ func makeRandomNode(port int, done chan bool) *Node {
n, _ := swarm.NewNetwork(context.Background(), []ma.Multiaddr{listen}, pid, peerStore, nil) n, _ := swarm.NewNetwork(context.Background(), []ma.Multiaddr{listen}, pid, peerStore, nil)
host := bhost.New(n) host := bhost.New(n)
log.Printf("New host id (base58 multihash):%s, length:%d", host.ID().Pretty(), len(host.ID().Pretty()))
return NewNode(host, done) return NewNode(host, done)
} }
...@@ -48,7 +46,7 @@ func main() { ...@@ -48,7 +46,7 @@ func main() {
log.Printf("This is a conversation between %s and %s\n", h1.ID(), h2.ID()) log.Printf("This is a conversation between %s and %s\n", h1.ID(), h2.ID())
// send messages using the protocols // test implemented protocols
h1.Ping(h2.Host) h1.Ping(h2.Host)
h2.Ping(h1.Host) h2.Ping(h1.Host)
h1.Echo(h2.Host) h1.Echo(h2.Host)
......
...@@ -51,8 +51,6 @@ func (p *PingProtocol) onPingRequest(s inet.Stream) { ...@@ -51,8 +51,6 @@ func (p *PingProtocol) onPingRequest(s inet.Stream) {
if !valid { if !valid {
log.Println("Failed to authenticate message") log.Println("Failed to authenticate message")
return return
} else {
//log.Println("Authenticated request content was generated by claimed node :-)")
} }
// generate response message // generate response message
...@@ -99,8 +97,6 @@ func (p *PingProtocol) onPingResponse(s inet.Stream) { ...@@ -99,8 +97,6 @@ func (p *PingProtocol) onPingResponse(s inet.Stream) {
if !valid { if !valid {
log.Println("Failed to authenticate message") log.Println("Failed to authenticate message")
return return
} else {
//log.Println("Authenticated response content generated by claimed node :-)")
} }
// locate request data and remove it if found // locate request data and remove it if found
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment