Browse Source

remove use of wire/nowriter

pull/1184/head
Ethan Buchman 7 years ago
parent
commit
426379dc47
1 changed files with 3 additions and 6 deletions
  1. +3
    -6
      p2p/conn/connection.go

+ 3
- 6
p2p/conn/connection.go View File

@ -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)
}


Loading…
Cancel
Save