Minor code cleanup

This commit is contained in:
Aviv Eyal 2017-11-29 12:36:56 +02:00 committed by Steven Allen
parent 49182bcfeb
commit 7702e9b8be
3 changed files with 1 additions and 11 deletions

View File

@ -50,8 +50,6 @@ func (e *EchoProtocol) onEchoRequest(s inet.Stream) {
if !valid {
log.Println("Failed to authenticate message")
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)
@ -100,8 +98,6 @@ func (e *EchoProtocol) onEchoResponse(s inet.Stream) {
if !valid {
log.Println("Failed to authenticate message")
return
} else {
//log.Println("Authenticated response content generated by claimed node :-)")
}
// locate request data and remove it if found

View File

@ -27,8 +27,6 @@ func makeRandomNode(port int, done chan bool) *Node {
n, _ := swarm.NewNetwork(context.Background(), []ma.Multiaddr{listen}, pid, peerStore, nil)
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)
}
@ -48,7 +46,7 @@ func main() {
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)
h2.Ping(h1.Host)
h1.Echo(h2.Host)

View File

@ -51,8 +51,6 @@ func (p *PingProtocol) onPingRequest(s inet.Stream) {
if !valid {
log.Println("Failed to authenticate message")
return
} else {
//log.Println("Authenticated request content was generated by claimed node :-)")
}
// generate response message
@ -99,8 +97,6 @@ func (p *PingProtocol) onPingResponse(s inet.Stream) {
if !valid {
log.Println("Failed to authenticate message")
return
} else {
//log.Println("Authenticated response content generated by claimed node :-)")
}
// locate request data and remove it if found