mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
swarm/network: Fix NewAddrFromNodeId
Signed-off-by: Lewis Marshall <lewis@lmars.net>
This commit is contained in:
parent
584d6e7876
commit
c9d42b9cf3
1 changed files with 5 additions and 1 deletions
|
|
@ -20,6 +20,7 @@ import (
|
|||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
|
|
@ -347,5 +348,8 @@ func NewNodeIdFromAddr(addr Addr) *adapters.NodeId {
|
|||
// the overlay address is derived as the hash of the nodeId
|
||||
func NewAddrFromNodeId(n *adapters.NodeId) *bzzAddr {
|
||||
id := n.NodeID
|
||||
return &bzzAddr{crypto.Keccak256(id[:]), id[:]}
|
||||
return &bzzAddr{
|
||||
OAddr: crypto.Keccak256(id[:]),
|
||||
UAddr: []byte(discover.NewNode(id, net.IP{127, 0, 0, 1}, 30303, 30303).String()),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue