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,12 +225,14 @@ 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 {
|
||||||
|
log.Error("invalid bzz address", "addr", baddr)
|
||||||
|
return
|
||||||
|
}
|
||||||
if enod.IP().IsLoopback() {
|
if enod.IP().IsLoopback() {
|
||||||
baddr.UAddr = []byte(paddr.String())
|
baddr.UAddr = []byte(paddr.String())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// runBzz is the p2p protocol run function for the bzz base protocol
|
// runBzz is the p2p protocol run function for the bzz base protocol
|
||||||
// that negotiates the bzz handshake
|
// that negotiates the bzz handshake
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue