aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/discover/database.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-04-23 18:11:21 +0800
committerFelix Lange <fjl@twurst.com>2015-04-30 21:02:23 +0800
commit72ab6d325555c742c6b70202d865ec23b50734d6 (patch)
tree92522e695c39ab4ee31321b5b469611f001fd684 /p2p/discover/database.go
parentb34a8ef624499e15cc3a2a51bddd94391f9b993e (diff)
downloaddexon-72ab6d325555c742c6b70202d865ec23b50734d6.tar.gz
dexon-72ab6d325555c742c6b70202d865ec23b50734d6.tar.zst
dexon-72ab6d325555c742c6b70202d865ec23b50734d6.zip
p2p/discover: track sha3(ID) in Node
Diffstat (limited to 'p2p/discover/database.go')
-rw-r--r--p2p/discover/database.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/p2p/discover/database.go b/p2p/discover/database.go
index 964f86b84..dc0b97ddf 100644
--- a/p2p/discover/database.go
+++ b/p2p/discover/database.go
@@ -10,6 +10,7 @@ import (
"sync"
"time"
+ "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/rlp"
@@ -167,6 +168,7 @@ func (db *nodeDB) node(id NodeID) *Node {
glog.V(logger.Warn).Infof("failed to decode node RLP: %v", err)
return nil
}
+ node.sha = crypto.Sha3Hash(node.ID[:])
return node
}