From a519eb7d5f1078b40cb35a9d719019f01b1b34a2 Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Fri, 1 Apr 2022 10:53:19 +1100 Subject: [PATCH 1/3] fix nil point --- aw.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 7c8dcedf9bdfa2876cdc2e90b237abc63dc9341d Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Fri, 1 Apr 2022 10:56:32 +1100 Subject: [PATCH 2/3] go mod tidy --- go.sum | 1 - 1 file changed, 1 deletion(-) 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= From cabae990f653c01909c6995f579092c46c9b2164 Mon Sep 17 00:00:00 2001 From: tok-kkk Date: Fri, 1 Apr 2022 10:57:36 +1100 Subject: [PATCH 3/3] adding go mod tidy in CI --- .github/workflows/go.yml | 1 + 1 file changed, 1 insertion(+) 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