mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
swarm/network: Add error log on invalid enode in uaddr
This commit is contained in:
parent
e489d77d4b
commit
a4df8a56a7
1 changed files with 6 additions and 4 deletions
|
|
@ -225,10 +225,12 @@ func (b *Bzz) performHandshake(p *protocols.Peer, handshake *HandshakeMsg) error
|
||||||
// it modifies the passed bzzaddr in place, and returns the same pointer
|
// it modifies the passed bzzaddr in place, and returns the same pointer
|
||||||
func sanitizeEnodeRemote(paddr *enode.Node, baddr *BzzAddr) {
|
func sanitizeEnodeRemote(paddr *enode.Node, baddr *BzzAddr) {
|
||||||
enod, err := enode.ParseV4(string(baddr.UAddr))
|
enod, err := enode.ParseV4(string(baddr.UAddr))
|
||||||
if err == nil {
|
if err != nil {
|
||||||
if enod.IP().IsLoopback() {
|
log.Error("invalid bzz address", "addr", baddr)
|
||||||
baddr.UAddr = []byte(paddr.String())
|
return
|
||||||
}
|
}
|
||||||
|
if enod.IP().IsLoopback() {
|
||||||
|
baddr.UAddr = []byte(paddr.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue