diff options
author | Felix Lange <fjl@twurst.com> | 2016-11-14 23:56:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-14 23:56:27 +0800 |
commit | d89ea3e6f90c32a97bad58b82a15af0d81f4250e (patch) | |
tree | 9acc32d1edca04b8a2b2894b3177f31c78f8298f /p2p/discv5/udp.go | |
parent | ca73dea3b9bcdf3b5424b5c48c70817439e2e304 (diff) | |
parent | b10bcd924ba79f9faa5b8f2d273a7ee02d7b89f5 (diff) | |
download | go-tangerine-d89ea3e6f90c32a97bad58b82a15af0d81f4250e.tar go-tangerine-d89ea3e6f90c32a97bad58b82a15af0d81f4250e.tar.gz go-tangerine-d89ea3e6f90c32a97bad58b82a15af0d81f4250e.tar.bz2 go-tangerine-d89ea3e6f90c32a97bad58b82a15af0d81f4250e.tar.lz go-tangerine-d89ea3e6f90c32a97bad58b82a15af0d81f4250e.tar.xz go-tangerine-d89ea3e6f90c32a97bad58b82a15af0d81f4250e.tar.zst go-tangerine-d89ea3e6f90c32a97bad58b82a15af0d81f4250e.zip |
Merge pull request #3253 from zsfelfoldi/light-topic3
Light client bugfixes and updates
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) |