Skip to content

Commit

Permalink
More Handshake Cleanup (#5863)
Browse files Browse the repository at this point in the history
* change to debug log

* disconnect on wrong fork

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
nisdas and prylabs-bulldozer[bot] committed May 15, 2020
1 parent 007a98b commit 320bb46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion beacon-chain/sync/rpc_status.go
Expand Up @@ -115,6 +115,12 @@ func (r *Service) sendRPCStatusRequest(ctx context.Context, id peer.ID) error {
err = r.validateStatusMessage(ctx, msg, stream)
if err != nil {
r.p2p.Peers().IncrementBadResponses(stream.Conn().RemotePeer())
// Disconnect if on a wrong fork.
if err == errWrongForkDigestVersion {
if err := r.sendGoodByeAndDisconnect(ctx, codeWrongNetwork, stream.Conn().RemotePeer()); err != nil {
return err
}
}
}
return err
}
Expand All @@ -125,7 +131,7 @@ func (r *Service) reValidatePeer(ctx context.Context, id peer.ID) error {
}
// Do not return an error for ping requests.
if err := r.sendPingRequest(ctx, id); err != nil {
log.WithError(err).Error("Could not ping peer")
log.WithError(err).Debug("Could not ping peer")
}
return nil
}
Expand Down

0 comments on commit 320bb46

Please sign in to comment.