diff --git a/go.mod b/go.mod index 5e5cfff26..df84059f8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/SkycoinProject/skywire-mainnet go 1.13 require ( - github.com/SkycoinProject/dmsg v0.0.0-20200304081751-cf4d40f5428f + github.com/SkycoinProject/dmsg v0.0.0-20200304115237-130cc9d98ffb github.com/SkycoinProject/skycoin v0.27.0 github.com/SkycoinProject/yamux v0.0.0-20191213015001-a36efeefbf6a github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 diff --git a/go.sum b/go.sum index faf572017..7220fb741 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/SkycoinProject/dmsg v0.0.0-20200304081751-cf4d40f5428f h1:NvirKQPrsp9xrJItJfmRwhfY7atS/AuzdGmJ76m703M= github.com/SkycoinProject/dmsg v0.0.0-20200304081751-cf4d40f5428f/go.mod h1:DzykXMLlx6Fx0fGjZsCIRas/MIvxW8DZpmDA6f2nCRk= +github.com/SkycoinProject/dmsg v0.0.0-20200304115237-130cc9d98ffb h1:UPgo4kZ/nFV4jI9djG0esOyZjda4IZGZpGl/ntYRyuM= +github.com/SkycoinProject/dmsg v0.0.0-20200304115237-130cc9d98ffb/go.mod h1:DzykXMLlx6Fx0fGjZsCIRas/MIvxW8DZpmDA6f2nCRk= github.com/SkycoinProject/skycoin v0.26.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= github.com/SkycoinProject/skycoin v0.27.0 h1:N3IHxj8ossHOcsxLYOYugT+OaELLncYHJHxbbYLPPmY= github.com/SkycoinProject/skycoin v0.27.0/go.mod h1:xqPLOKh5B6GBZlGA7B5IJfQmCy7mwimD9NlqxR3gMXo= diff --git a/pkg/transport/handshake.go b/pkg/transport/handshake.go index cf9d52a88..e18dc02e3 100644 --- a/pkg/transport/handshake.go +++ b/pkg/transport/handshake.go @@ -6,8 +6,10 @@ import ( "errors" "fmt" "io" + "net/http" "github.com/SkycoinProject/dmsg/cipher" + "github.com/SkycoinProject/dmsg/httputil" "github.com/SkycoinProject/skywire-mainnet/pkg/snet" ) @@ -130,7 +132,12 @@ func MakeSettlementHS(init bool) SettlementHS { // Ensure transport is registered. if err := dc.RegisterTransports(ctx, recvSE); err != nil { - log.WithError(err).Error("Failed to register transports") + if httpErr, ok := err.(*httputil.HTTPError); ok && httpErr.Status == http.StatusConflict { + log.WithError(err).Debug("An expected error occurred while trying to register transport.") + } else { + // TODO(evanlinjin): Once tpDisc is updated, this should return error and result in failed HS. + log.WithError(err).Error("Failed to register transport.") + } } // inform initiating visor. diff --git a/vendor/github.com/SkycoinProject/dmsg/httputil/error.go b/vendor/github.com/SkycoinProject/dmsg/httputil/error.go index 6060dd66a..5b545990a 100644 --- a/vendor/github.com/SkycoinProject/dmsg/httputil/error.go +++ b/vendor/github.com/SkycoinProject/dmsg/httputil/error.go @@ -27,7 +27,7 @@ func ErrorFromResp(resp *http.Response) error { // Error returns the error message. func (e *HTTPError) Error() string { - return fmt.Sprintf("(%d)%s: %v", e.Status, http.StatusText(e.Status), e.Body) + return fmt.Sprintf("%d %s: %v", e.Status, http.StatusText(e.Status), e.Body) } // Timeout implements net.Error diff --git a/vendor/modules.txt b/vendor/modules.txt index 176ebd069..2ece7f09d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/SkycoinProject/dmsg v0.0.0-20200304081751-cf4d40f5428f +# github.com/SkycoinProject/dmsg v0.0.0-20200304115237-130cc9d98ffb github.com/SkycoinProject/dmsg github.com/SkycoinProject/dmsg/cipher github.com/SkycoinProject/dmsg/disc