From b9a8c2d6e6b779f4cb983155257298696ca54558 Mon Sep 17 00:00:00 2001 From: Dmytro Date: Tue, 24 Oct 2023 11:49:48 +0300 Subject: [PATCH] sentry: error checking fix (#8566) --- cmd/sentry/sentry/sentry_grpc_server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/sentry/sentry/sentry_grpc_server.go b/cmd/sentry/sentry/sentry_grpc_server.go index 6e908638c..7f5359094 100644 --- a/cmd/sentry/sentry/sentry_grpc_server.go +++ b/cmd/sentry/sentry/sentry_grpc_server.go @@ -627,7 +627,7 @@ func NewGrpcServer(ctx context.Context, dialCandidates func() enode.Iterator, re ss.GoodPeers.Store(peerID, peerInfo) ss.sendNewPeerToClients(gointerfaces.ConvertHashToH512(peerID)) getBlockHeadersErr := ss.getBlockHeaders(ctx, *peerBestHash, peerID) - if err != nil { + if getBlockHeadersErr != nil { return p2p.NewPeerError(p2p.PeerErrorFirstMessageSend, p2p.DiscNetworkError, getBlockHeadersErr, "p2p.Protocol.Run getBlockHeaders failure") }