From 00c7ab917847b8b12b6542b8600a57aaccd83b57 Mon Sep 17 00:00:00 2001 From: Balint Gabor Date: Fri, 12 Jan 2018 09:38:43 +0100 Subject: [PATCH] Use discover.PubkeyID to generate node id in simulation --- p2p/simulations/adapters/types.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/p2p/simulations/adapters/types.go b/p2p/simulations/adapters/types.go index 5b4b47fe2f..3f76b19843 100644 --- a/p2p/simulations/adapters/types.go +++ b/p2p/simulations/adapters/types.go @@ -163,9 +163,8 @@ func RandomNodeConfig() *NodeConfig { if err != nil { panic("unable to generate key") } - var id discover.NodeID - pubkey := crypto.FromECDSAPub(&key.PublicKey) - copy(id[:], pubkey[1:]) + + id := discover.PubkeyID(&key.PublicKey) return &NodeConfig{ ID: id, PrivateKey: key,