diff options
author | obscuren <geffobscura@gmail.com> | 2014-01-18 00:51:40 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-01-18 00:51:40 +0800 |
commit | 5e5f386108ea4b75167bad96a2bf7cd801306045 (patch) | |
tree | 5c80b096e17ee8bc25de773d705c0d99775fd1a5 | |
parent | 87434a09418e6cc2dd4b92d7e35afc6f155994bc (diff) | |
download | go-tangerine-5e5f386108ea4b75167bad96a2bf7cd801306045.tar.gz go-tangerine-5e5f386108ea4b75167bad96a2bf7cd801306045.tar.zst go-tangerine-5e5f386108ea4b75167bad96a2bf7cd801306045.zip |
Renamed InOutMsg to msg
-rw-r--r-- | peer.go | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -20,7 +20,7 @@ type Peer struct { // Net connection conn net.Conn // Output queue which is used to communicate and handle messages - outputQueue chan *ethwire.InOutMsg + outputQueue chan *ethwire.Msg // Quit channel quit chan bool // Determines whether it's an inbound or outbound peer @@ -41,7 +41,7 @@ type Peer struct { func NewPeer(conn net.Conn, server *Server, inbound bool) *Peer { return &Peer{ - outputQueue: make(chan *ethwire.InOutMsg, outputBufferSize), + outputQueue: make(chan *ethwire.Msg, outputBufferSize), quit: make(chan bool), server: server, conn: conn, @@ -53,7 +53,7 @@ func NewPeer(conn net.Conn, server *Server, inbound bool) *Peer { func NewOutboundPeer(addr string, server *Server) *Peer { p := &Peer{ - outputQueue: make(chan *ethwire.InOutMsg, outputBufferSize), + outputQueue: make(chan *ethwire.Msg, outputBufferSize), quit: make(chan bool), server: server, inbound: false, @@ -82,11 +82,11 @@ func NewOutboundPeer(addr string, server *Server) *Peer { } // Outputs any RLP encoded data to the peer -func (p *Peer) QueueMessage(msg *ethwire.InOutMsg) { +func (p *Peer) QueueMessage(msg *ethwire.Msg) { p.outputQueue <- msg } -func (p *Peer) writeMessage(msg *ethwire.InOutMsg) { +func (p *Peer) writeMessage(msg *ethwire.Msg) { // Ignore the write if we're not connected if atomic.LoadInt32(&p.connected) != 1 { return @@ -123,7 +123,7 @@ out: p.lastSend = time.Now() case <-tickleTimer.C: - p.writeMessage(ðwire.InOutMsg{Type: ethwire.MsgPingTy}) + p.writeMessage(ðwire.Msg{Type: ethwire.MsgPingTy}) // Break out of the for loop if a quit message is posted case <-p.quit: @@ -177,7 +177,7 @@ out: case ethwire.MsgPeersTy: case ethwire.MsgPingTy: // Respond back with pong - p.writeMessage(ðwire.InOutMsg{Type: ethwire.MsgPongTy}) + p.writeMessage(ðwire.Msg{Type: ethwire.MsgPongTy}) case ethwire.MsgPongTy: p.lastPong = time.Now().Unix() @@ -231,7 +231,7 @@ func (p *Peer) pushHandshake() error { return nil } -func (p *Peer) handleHandshake(msg *ethwire.InOutMsg) { +func (p *Peer) handleHandshake(msg *ethwire.Msg) { c := ethutil.Conv(msg.Data) // [PROTOCOL_VERSION, NETWORK_ID, CLIENT_ID] if c.Get(2).AsUint() == p.server.Nonce { |