aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/table.go
diff options
context:
space:
mode:
authorRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 02:40:27 +0800
committerRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 06:34:34 +0800
commit436fc8d76a4871d67a61dc86c1a635e20594a0e6 (patch)
tree5fad9f69b068f43ca606e2887f5522188e7f9ddd /p2p/discover/table.go
parentc20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c (diff)
downloadgo-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.gz
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.bz2
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.lz
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.xz
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.zst
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.zip
all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()
As we aren't really using the standarized SHA-3
Diffstat (limited to 'p2p/discover/table.go')
-rw-r--r--p2p/discover/table.go6
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)