Browse Source

better upnp error msgs

pull/110/head
Ethan Buchman 10 years ago
parent
commit
fadfc673e3
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      p2p/listener.go
  2. +2
    -2
      p2p/pex_reactor.go

+ 2
- 2
p2p/listener.go View File

@ -160,7 +160,7 @@ func getUPNPExternalAddress(externalPort, internalPort int) *NetAddress {
log.Debug("Getting UPNP external address")
nat, err := upnp.Discover()
if err != nil {
log.Debug("Could not get UPNP extrernal address", "error", err)
log.Debug("Could not perform UPNP discover", "error", err)
return nil
}
@ -177,7 +177,7 @@ func getUPNPExternalAddress(externalPort, internalPort int) *NetAddress {
externalPort, err = nat.AddPortMapping("tcp", externalPort, internalPort, "tendermint", 0)
if err != nil {
log.Debug("Could not get UPNP external address", "error", err)
log.Debug("Could not add UPNP port mapping", "error", err)
return nil
}


+ 2
- 2
p2p/pex_reactor.go View File

@ -101,7 +101,7 @@ func (pexR *PEXReactor) Receive(chId byte, src *Peer, msgBytes []byte) {
}
log.Info("Received message", "msg", msg)
switch msg.(type) {
switch msgT := msg.(type) {
case *pexRequestMessage:
// src requested some peers.
// TODO: prevent abuse.
@ -111,7 +111,7 @@ func (pexR *PEXReactor) Receive(chId byte, src *Peer, msgBytes []byte) {
// TODO: prevent abuse.
// (We don't want to get spammed with bad peers)
srcAddr := src.Connection().RemoteAddress
for _, addr := range msg.(*pexAddrsMessage).Addrs {
for _, addr := range msgT.Addrs {
pexR.book.AddAddress(addr, srcAddr)
}
default:


Loading…
Cancel
Save