mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
p2p/discover: remove conversion
This commit is contained in:
parent
24bba50d5d
commit
448250f012
1 changed files with 1 additions and 2 deletions
|
|
@ -298,13 +298,12 @@ func (t *UDPv4) newRandomLookup(ctx context.Context) *lookup {
|
||||||
|
|
||||||
func (t *UDPv4) newLookup(ctx context.Context, targetKey v4wire.Pubkey) *lookup {
|
func (t *UDPv4) newLookup(ctx context.Context, targetKey v4wire.Pubkey) *lookup {
|
||||||
target := enode.ID(crypto.Keccak256Hash(targetKey[:]))
|
target := enode.ID(crypto.Keccak256Hash(targetKey[:]))
|
||||||
ekey := v4wire.Pubkey(targetKey)
|
|
||||||
it := newLookup(ctx, t.tab, target, func(n *enode.Node) ([]*enode.Node, error) {
|
it := newLookup(ctx, t.tab, target, func(n *enode.Node) ([]*enode.Node, error) {
|
||||||
addr, ok := n.UDPEndpoint()
|
addr, ok := n.UDPEndpoint()
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errNoUDPEndpoint
|
return nil, errNoUDPEndpoint
|
||||||
}
|
}
|
||||||
return t.findnode(n.ID(), addr, ekey)
|
return t.findnode(n.ID(), addr, targetKey)
|
||||||
})
|
})
|
||||||
return it
|
return it
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue