Skip to content

Commit

Permalink
Merge pull request #465 from libp2p/fix/mock-race-really
Browse files Browse the repository at this point in the history
*really* fix the race in mock
  • Loading branch information
Stebalien authored Oct 24, 2018
2 parents 8af9bc6 + 80c5998 commit 91514ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/net/mock/mock_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (s *stream) Write(p []byte) (n int, err error) {
select {
case <-s.closed: // bail out if we're closing.
return 0, s.writeErr
case s.toDeliver <- &transportObject{msg: p, arrivalTime: t}:
case s.toDeliver <- &transportObject{msg: cpy, arrivalTime: t}:
}
return len(p), nil
}
Expand Down

0 comments on commit 91514ce

Please sign in to comment.