diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a8156e7..27c12a4 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,6 +31,7 @@ jobs: go get -u github.com/loongy/covermerge go get -u github.com/mattn/goveralls cd $GITHUB_WORKSPACE + go mod tidy go vet ./... golint ./... - name: Run tests and report test coverage diff --git a/aw.go b/aw.go index 3f9216c..37fc4ec 100644 --- a/aw.go +++ b/aw.go @@ -827,7 +827,7 @@ func (peer *Peer) handleEvent(e event) { numErrors := 0 for _, recipient := range peers { if err := peer.handleSendMessage(recipient, message); err != nil { - if recipient.Equal(e.hint) { + if e.hint != nil && recipient.Equal(e.hint) { peer.Opts.Logger.Warn("unable to sync from hinted peer", zap.Error(err)) } numErrors++ @@ -1229,7 +1229,7 @@ func (peer *Peer) handleSendMessage(remote id.Signatory, message wire.Msg) error return nil case <-ctx.Done(): - if peer.ctx.Err() == nil { + if ctx.Err() == nil { return ErrMessageBufferFull } else { return nil diff --git a/go.sum b/go.sum index 0de980a..9a62e47 100644 --- a/go.sum +++ b/go.sum @@ -77,7 +77,6 @@ github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/gorilla/websocket v1.4.1-0.20190629185528-ae1634f6a989/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=