From 426379dc47b8d179583f97305c21b4731dbefe04 Mon Sep 17 00:00:00 2001 From: Ethan Buchman Date: Sat, 3 Feb 2018 03:39:14 -0500 Subject: [PATCH] remove use of wire/nowriter --- p2p/conn/connection.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/p2p/conn/connection.go b/p2p/conn/connection.go index 83d87e58f..451f35bbe 100644 --- a/p2p/conn/connection.go +++ b/p2p/conn/connection.go @@ -11,14 +11,11 @@ import ( "time" wire "github.com/tendermint/go-wire" - tmlegacy "github.com/tendermint/go-wire/nowriter/tmlegacy" cmn "github.com/tendermint/tmlibs/common" flow "github.com/tendermint/tmlibs/flowrate" "github.com/tendermint/tmlibs/log" ) -var legacy = tmlegacy.TMEncoderLegacy{} - const ( numBatchMsgPackets = 10 minReadBufferSize = 1024 @@ -316,12 +313,12 @@ FOR_LOOP: } case <-c.pingTimer.Chan(): c.Logger.Debug("Send Ping") - legacy.WriteOctet(packetTypePing, c.bufWriter, &n, &err) + wire.WriteByte(packetTypePing, c.bufWriter, &n, &err) c.sendMonitor.Update(int(n)) c.flush() case <-c.pong: c.Logger.Debug("Send Pong") - legacy.WriteOctet(packetTypePong, c.bufWriter, &n, &err) + wire.WriteByte(packetTypePong, c.bufWriter, &n, &err) c.sendMonitor.Update(int(n)) c.flush() case <-c.quit: @@ -681,7 +678,7 @@ func (ch *Channel) writeMsgPacketTo(w io.Writer) (n int, err error) { } func writeMsgPacketTo(packet msgPacket, w io.Writer, n *int, err *error) { - legacy.WriteOctet(packetTypeMsg, w, n, err) + wire.WriteByte(packetTypeMsg, w, n, err) wire.WriteBinary(packet, w, n, err) }