mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 17:33:47 +00:00
Use discover.PubkeyID to generate node id in simulation
This commit is contained in:
parent
4d4a67a9cb
commit
00c7ab9178
1 changed files with 2 additions and 3 deletions
|
|
@ -163,9 +163,8 @@ func RandomNodeConfig() *NodeConfig {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("unable to generate key")
|
panic("unable to generate key")
|
||||||
}
|
}
|
||||||
var id discover.NodeID
|
|
||||||
pubkey := crypto.FromECDSAPub(&key.PublicKey)
|
id := discover.PubkeyID(&key.PublicKey)
|
||||||
copy(id[:], pubkey[1:])
|
|
||||||
return &NodeConfig{
|
return &NodeConfig{
|
||||||
ID: id,
|
ID: id,
|
||||||
PrivateKey: key,
|
PrivateKey: key,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue