From f468a9a0e236f8467012ffe35c1d8ff58e30a81a Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 15:46:46 +0100 Subject: Enable websockets for mist. Closes #218 --- cmd/mist/main.go | 4 ++++ cmd/utils/websockets.go | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/cmd/mist/main.go b/cmd/mist/main.go index eaf0af0c7..5f809f1c5 100644 --- a/cmd/mist/main.go +++ b/cmd/mist/main.go @@ -69,6 +69,10 @@ func run() error { utils.StartRpc(ethereum, RpcPort) } + if StartWebSockets { + utils.StartWebSockets(ethereum) + } + gui := NewWindow(ethereum, config, clientIdentity, KeyRing, LogLevel) gui.stdLog = stdLog diff --git a/cmd/utils/websockets.go b/cmd/utils/websockets.go index d3ba50e78..cf9ebba92 100644 --- a/cmd/utils/websockets.go +++ b/cmd/utils/websockets.go @@ -3,10 +3,13 @@ package utils import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/ethutil" + "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/websocket" "github.com/ethereum/go-ethereum/xeth" ) +var wslogger = logger.NewLogger("WS") + func args(v ...interface{}) []interface{} { return v } @@ -106,6 +109,8 @@ func (self *WebSocketServer) Serv() { } func StartWebSockets(eth *eth.Ethereum) { + wslogger.Infoln("Starting WebSockets") + sock := NewWebSocketServer(eth) go sock.Serv() } -- cgit From 7ba9fe4d5d46d4a9373327d52d1c0e82d5933bc1 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 24 Dec 2014 11:29:58 +0100 Subject: Reset peer during download on disc --- peer.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/peer.go b/peer.go index 13f0239d4..ceb49a5af 100644 --- a/peer.go +++ b/peer.go @@ -412,6 +412,12 @@ func (p *Peer) HandleInbound() { //} case wire.MsgDiscTy: + blockPool := p.ethereum.blockPool + if blockPool.peer == p { + blockPool.peer = nil + blockPool.td = ethutil.Big0 + } + p.Stop() peerlogger.Infoln("Disconnect peer: ", DiscReason(msg.Data.Get(0).Uint())) case wire.MsgPingTy: -- cgit From c9f963a77e6e728c90e08c0e0008f1dc40df1fe0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 24 Dec 2014 11:30:04 +0100 Subject: Bump --- cmd/ethereum/main.go | 2 +- cmd/mist/main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index 2a3c46054..30107c145 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -30,7 +30,7 @@ import ( const ( ClientIdentifier = "Ethereum(G)" - Version = "0.7.10" + Version = "0.7.11" ) var clilogger = logger.NewLogger("CLI") diff --git a/cmd/mist/main.go b/cmd/mist/main.go index eaf0af0c7..c6dc80171 100644 --- a/cmd/mist/main.go +++ b/cmd/mist/main.go @@ -31,7 +31,7 @@ import ( const ( ClientIdentifier = "Mist" - Version = "0.7.10" + Version = "0.7.11" ) var ethereum *eth.Ethereum -- cgit