mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 04:47:18 +00:00
Prevent panic on wrong interface conversion (#4803)
* Prevent panic on wrong interface conversion * remove import
This commit is contained in:
parent
f14ff34797
commit
7e0d0502aa
@ -27,7 +27,10 @@ func (r *Service) goodbyeRPCHandler(ctx context.Context, msg interface{}, stream
|
||||
defer cancel()
|
||||
setRPCStreamDeadlines(stream)
|
||||
|
||||
m := msg.(uint64)
|
||||
m, ok:= msg.(uint64)
|
||||
if !ok {
|
||||
return fmt.Errorf("wrong message type for goodbye, got %T, wanted uint64", msg)
|
||||
}
|
||||
log := log.WithField("Reason", goodbyeMessage(m))
|
||||
log.WithField("peer", stream.Conn().RemotePeer()).Info("Peer has sent a goodbye message")
|
||||
// closes all streams with the peer
|
||||
|
Loading…
Reference in New Issue
Block a user