re-add that truncate in case it's related to misreads

This commit is contained in:
Josh Deprez 2021-01-10 20:51:14 +11:00
parent 137a895704
commit c16b5f973e

View file

@ -56,8 +56,7 @@ func (c *sungrowConn) Write(msg []byte) (int, error) {
c.mu.Lock() c.mu.Lock()
defer c.mu.Unlock() defer c.mu.Unlock()
c.txid = binary.BigEndian.Uint16(msg[:2]) c.txid = binary.BigEndian.Uint16(msg[:2])
c.fifo.Truncate(0)
//c.fifo.Truncate(0)
bs := c.block.BlockSize() bs := c.block.BlockSize()
padlen := bs - (len(msg) % bs) padlen := bs - (len(msg) % bs)