p2p/discover: fix crash in Resolve (#19579)

pull/19586/head
Felix Lange 6 years ago committed by GitHub
parent 4b9c3bd39a
commit b548b5aeb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      p2p/discover/v4_udp.go

@ -426,11 +426,11 @@ func (t *UDPv4) Resolve(n *enode.Node) *enode.Node {
}
}
// Otherwise perform a network lookup.
var key *enode.Secp256k1
if n.Load(key) != nil {
var key enode.Secp256k1
if n.Load(&key) != nil {
return n // no secp256k1 key
}
result := t.LookupPubkey((*ecdsa.PublicKey)(key))
result := t.LookupPubkey((*ecdsa.PublicKey)(&key))
for _, rn := range result {
if rn.ID() == n.ID() {
if rn, err := t.requestENR(rn); err == nil {

Loading…
Cancel
Save