use go-libp2p-core/peer instead of the deprecated alias, try to pacify the silly linter

This commit is contained in:
vyzo 2020-05-05 17:12:06 +03:00
parent 4e5179557d
commit eb24baa70c
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import (
"github.com/ipfs/go-cid"
logging "github.com/ipfs/go-log/v2"
connmgr "github.com/libp2p/go-libp2p-core/connmgr"
peer "github.com/libp2p/go-libp2p-peer"
"github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"go.opencensus.io/stats"
"go.opencensus.io/tag"
@ -42,6 +42,7 @@ func HandleIncomingBlocks(ctx context.Context, bsub *pubsub.Subscription, s *cha
return
}
//nolint:golint
src := peer.ID(msg.GetFrom())
go func() {
@ -198,9 +199,8 @@ func (mv *MessageValidator) Validate(ctx context.Context, pid peer.ID, msg *pubs
stats.Record(ctx, metrics.MessageValidationFailure.M(1))
if xerrors.Is(err, messagepool.ErrBroadcastAnyway) {
return pubsub.ValidationAccept
} else {
return pubsub.ValidationIgnore
}
return pubsub.ValidationIgnore
}
stats.Record(ctx, metrics.MessageValidationSuccess.M(1))
return pubsub.ValidationAccept

View File

@ -6,7 +6,7 @@ import (
eventbus "github.com/libp2p/go-eventbus"
event "github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/host"
peer "github.com/libp2p/go-libp2p-peer"
"github.com/libp2p/go-libp2p-core/peer"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"go.uber.org/fx"
"golang.org/x/xerrors"