diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-11-13 04:02:02 +0800 |
---|---|---|
committer | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-11-14 20:22:19 +0800 |
commit | e33e57684fcd364900a896aa3e759bf4821c02e1 (patch) | |
tree | 468ce7630903528a4f4082936bae659816976ec5 /p2p/discv5/udp.go | |
parent | a0c6649960bb4b1155181915d898d066af00a8cb (diff) | |
download | go-tangerine-e33e57684fcd364900a896aa3e759bf4821c02e1.tar go-tangerine-e33e57684fcd364900a896aa3e759bf4821c02e1.tar.gz go-tangerine-e33e57684fcd364900a896aa3e759bf4821c02e1.tar.bz2 go-tangerine-e33e57684fcd364900a896aa3e759bf4821c02e1.tar.lz go-tangerine-e33e57684fcd364900a896aa3e759bf4821c02e1.tar.xz go-tangerine-e33e57684fcd364900a896aa3e759bf4821c02e1.tar.zst go-tangerine-e33e57684fcd364900a896aa3e759bf4821c02e1.zip |
p2p/discv5: fixed bootnode connect issues
Diffstat (limited to 'p2p/discv5/udp.go')
-rw-r--r-- | p2p/discv5/udp.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/p2p/discv5/udp.go b/p2p/discv5/udp.go index af961984c..46d3200bf 100644 --- a/p2p/discv5/udp.go +++ b/p2p/discv5/udp.go @@ -336,14 +336,17 @@ func (t *udp) sendTopicNodes(remote *Node, queryHash common.Hash, nodes []*Node) } func (t *udp) sendPacket(toid NodeID, toaddr *net.UDPAddr, ptype byte, req interface{}) (hash []byte, err error) { + //fmt.Println("sendPacket", nodeEvent(ptype), toaddr.String(), toid.String()) packet, hash, err := encodePacket(t.priv, ptype, req) if err != nil { + //fmt.Println(err) return hash, err } glog.V(logger.Detail).Infof(">>> %v to %x@%v\n", nodeEvent(ptype), toid[:8], toaddr) if _, err = t.conn.WriteToUDP(packet, toaddr); err != nil { glog.V(logger.Detail).Infoln("UDP send failed:", err) } + //fmt.Println(err) return hash, err } @@ -406,6 +409,7 @@ func (t *udp) handlePacket(from *net.UDPAddr, buf []byte) error { pkt := ingressPacket{remoteAddr: from} if err := decodePacket(buf, &pkt); err != nil { glog.V(logger.Debug).Infof("Bad packet from %v: %v\n", from, err) + //fmt.Println("bad packet", err) return err } t.net.reqReadPacket(pkt) |