diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-02-24 19:57:57 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2016-02-24 19:57:57 +0800 |
commit | 483feb0d3f015f103f80dbaf2aca9a130f5d964c (patch) | |
tree | 8137bf41be9b84bc6797ec55c861332b2efc3ab1 /p2p/discover/table.go | |
parent | 1415669ac31cf8f06d107e06681b95c2b5e1c040 (diff) | |
parent | 139f6a0f4c1b3358a92bdfb5637878b2c97eba78 (diff) | |
download | go-tangerine-483feb0d3f015f103f80dbaf2aca9a130f5d964c.tar.gz go-tangerine-483feb0d3f015f103f80dbaf2aca9a130f5d964c.tar.zst go-tangerine-483feb0d3f015f103f80dbaf2aca9a130f5d964c.zip |
Merge pull request #2242 from jimenezrick/upstream-crypto
Closes #2241: Use Keccak-256 from golang.org/x/crypto/sha3 and mention explicitly
Diffstat (limited to 'p2p/discover/table.go')
-rw-r--r-- | p2p/discover/table.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/p2p/discover/table.go b/p2p/discover/table.go index abb7980f8..1de045f04 100644 --- a/p2p/discover/table.go +++ b/p2p/discover/table.go @@ -195,7 +195,7 @@ func (tab *Table) SetFallbackNodes(nodes []*Node) error { cpy := *n // Recompute cpy.sha because the node might not have been // created by NewNode or ParseNode. - cpy.sha = crypto.Sha3Hash(n.ID[:]) + cpy.sha = crypto.Keccak256Hash(n.ID[:]) tab.nursery = append(tab.nursery, &cpy) } tab.mutex.Unlock() @@ -208,7 +208,7 @@ func (tab *Table) SetFallbackNodes(nodes []*Node) error { func (tab *Table) Resolve(targetID NodeID) *Node { // If the node is present in the local table, no // network interaction is required. - hash := crypto.Sha3Hash(targetID[:]) + hash := crypto.Keccak256Hash(targetID[:]) tab.mutex.Lock() cl := tab.closest(hash, 1) tab.mutex.Unlock() @@ -236,7 +236,7 @@ func (tab *Table) Lookup(targetID NodeID) []*Node { func (tab *Table) lookup(targetID NodeID, refreshIfEmpty bool) []*Node { var ( - target = crypto.Sha3Hash(targetID[:]) + target = crypto.Keccak256Hash(targetID[:]) asked = make(map[NodeID]bool) seen = make(map[NodeID]bool) reply = make(chan []*Node, alpha) |