mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-31 12:11:58 +00:00
remove use of wire/nowriter
This commit is contained in:
@@ -11,14 +11,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
wire "github.com/tendermint/go-wire"
|
wire "github.com/tendermint/go-wire"
|
||||||
tmlegacy "github.com/tendermint/go-wire/nowriter/tmlegacy"
|
|
||||||
cmn "github.com/tendermint/tmlibs/common"
|
cmn "github.com/tendermint/tmlibs/common"
|
||||||
flow "github.com/tendermint/tmlibs/flowrate"
|
flow "github.com/tendermint/tmlibs/flowrate"
|
||||||
"github.com/tendermint/tmlibs/log"
|
"github.com/tendermint/tmlibs/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
var legacy = tmlegacy.TMEncoderLegacy{}
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
numBatchMsgPackets = 10
|
numBatchMsgPackets = 10
|
||||||
minReadBufferSize = 1024
|
minReadBufferSize = 1024
|
||||||
@@ -316,12 +313,12 @@ FOR_LOOP:
|
|||||||
}
|
}
|
||||||
case <-c.pingTimer.Chan():
|
case <-c.pingTimer.Chan():
|
||||||
c.Logger.Debug("Send Ping")
|
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.sendMonitor.Update(int(n))
|
||||||
c.flush()
|
c.flush()
|
||||||
case <-c.pong:
|
case <-c.pong:
|
||||||
c.Logger.Debug("Send 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.sendMonitor.Update(int(n))
|
||||||
c.flush()
|
c.flush()
|
||||||
case <-c.quit:
|
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) {
|
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)
|
wire.WriteBinary(packet, w, n, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user