Skip to content

Commit

Permalink
Fix invertedIDConn logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Jun 7, 2019
1 parent 687362f commit 5aebac4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions pkg/dmsg/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"net"
"testing"
"time"

"github.com/skycoin/skycoin/src/util/logging"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -44,13 +43,9 @@ func TestClient(t *testing.T) {
_ = conn2.Serve(ctx, ch2)
}()

time.Sleep(100 * time.Millisecond)

tr, err := conn1.DialTransport(ctx, pk2)
assert.NoError(t, err)

time.Sleep(100 * time.Millisecond)

err = tr.Close()
assert.NoError(t, err)
}
Expand All @@ -61,8 +56,6 @@ type invertedIDConn struct {

func (c invertedIDConn) Write(b []byte) (n int, err error) {
frame := Frame(b)

newID := randID(!isInitiatorID(frame.TpID()))
newFrame := MakeFrame(frame.Type(), newID, frame.Pay())
newFrame := MakeFrame(frame.Type(), frame.TpID()^1, frame.Pay())
return c.Conn.Write(newFrame)
}

0 comments on commit 5aebac4

Please sign in to comment.