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

This commit is contained in:
Felix Lange 2019-05-15 11:11:17 -04:00 committed by GitHub
parent 4b9c3bd39a
commit b548b5aeb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

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