mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-26 23:32:15 +00:00
Fixes https://github.com/tendermint/tendermint/issues/851
Go1.9 and below's net.Pipe did not implement the SetDeadline
method so after commit
e2dd8ca946
this problem was exposed since now we check for errors.
To counter this problem, implement a simple composition for
net.Conn that always returns nil on SetDeadline instead of
tripping out.
Added build tags so that anyone using go1.10 when it is released
will be able to automatically use net.Pipe's net.Conns
16 lines
377 B
Go
16 lines
377 B
Go
// +build go1.10
|
|
|
|
package p2p
|
|
|
|
// Go1.10 has a proper net.Conn implementation that
|
|
// has the SetDeadline method implemented as per
|
|
// https://github.com/golang/go/commit/e2dd8ca946be884bb877e074a21727f1a685a706
|
|
// lest we run into problems like
|
|
// https://github.com/tendermint/tendermint/issues/851
|
|
|
|
import "net"
|
|
|
|
func netPipe() (net.Conn, net.Conn) {
|
|
return net.Pipe()
|
|
}
|