aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-28 23:45:29 +0800
committerobscuren <geffobscura@gmail.com>2014-02-28 23:45:29 +0800
commit601340bd464e3ebae0e4fa3407be5fff3bb3fcbf (patch)
tree0754f60c7154bc74042e41769b9b4da824f9126d
parent839bd73fbb525f6c51e4205ce6519b6154cda2f0 (diff)
downloaddexon-601340bd464e3ebae0e4fa3407be5fff3bb3fcbf.tar
dexon-601340bd464e3ebae0e4fa3407be5fff3bb3fcbf.tar.gz
dexon-601340bd464e3ebae0e4fa3407be5fff3bb3fcbf.tar.bz2
dexon-601340bd464e3ebae0e4fa3407be5fff3bb3fcbf.tar.lz
dexon-601340bd464e3ebae0e4fa3407be5fff3bb3fcbf.tar.xz
dexon-601340bd464e3ebae0e4fa3407be5fff3bb3fcbf.tar.zst
dexon-601340bd464e3ebae0e4fa3407be5fff3bb3fcbf.zip
Fixed shutting down
-rw-r--r--ethereum.go2
-rw-r--r--peer.go5
2 files changed, 3 insertions, 4 deletions
diff --git a/ethereum.go b/ethereum.go
index 90682b396..b4a8cdb4a 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -295,7 +295,7 @@ func (s *Ethereum) Stop() {
s.TxPool.Stop()
s.BlockManager.Stop()
- s.shutdownChan <- true
+ close(s.shutdownChan)
}
// This function will wait for a shutdown and resumes main thread execution
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