From 601340bd464e3ebae0e4fa3407be5fff3bb3fcbf Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 28 Feb 2014 16:45:29 +0100 Subject: [PATCH 1/2] Fixed shutting down --- ethereum.go | 2 +- peer.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ethereum.go b/ethereum.go index 90682b396d..b4a8cdb4ad 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 a8708206f3..9706197146 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 From b462ca4aade75049a0fcba23c54e340f0f793dfb Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 28 Feb 2014 16:45:46 +0100 Subject: [PATCH 2/2] Bump --- ethutil/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethutil/config.go b/ethutil/config.go index 5bf56134d1..5fdc8e1c56 100644 --- a/ethutil/config.go +++ b/ethutil/config.go @@ -46,7 +46,7 @@ func ReadConfig(base string) *config { } } - Config = &config{ExecPath: path, Debug: true, Ver: "0.3.0"} + Config = &config{ExecPath: path, Debug: true, Ver: "0.3.1"} Config.Log = NewLogger(LogFile|LogStd, LogLevelDebug) }