diff --git a/p2p/peer_error.go b/p2p/peer_error.go index ab61bfef0..393cc86b0 100644 --- a/p2p/peer_error.go +++ b/p2p/peer_error.go @@ -89,7 +89,7 @@ var discReasonToString = [...]string{ } func (d DiscReason) String() string { - if len(discReasonToString) < int(d) { + if len(discReasonToString) <= int(d) { return fmt.Sprintf("unknown disconnect reason %d", d) } return discReasonToString[d]