aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/peer.go b/peer.go
index a8708206f..970619714 100644
--- a/peer.go
+++ b/peer.go
@@ -511,9 +511,8 @@ func (p *Peer) handleHandshake(msg *ethwire.Msg) {
p.port = uint16(c.Get(4).Uint())
// Self connect detection
- data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
- pubkey := ethutil.NewValueFromBytes(data).Get(2).Bytes()
- if bytes.Compare(pubkey, p.pubkey) == 0 {
+ key := ethutil.Config.Db.GetKeys()[0]
+ if bytes.Compare(key.PublicKey, p.pubkey) == 0 {
p.Stop()
return