aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--p2p/discv5/net.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go
index 9b0bd0c80..4c39c0553 100644
--- a/p2p/discv5/net.go
+++ b/p2p/discv5/net.go
@@ -1228,7 +1228,7 @@ func (net *Network) checkTopicRegister(data *topicRegister) (*pong, error) {
if rlpHash(data.Topics) != pongpkt.data.(*pong).TopicHash {
return nil, errors.New("topic hash mismatch")
}
- if data.Idx < 0 || int(data.Idx) >= len(data.Topics) {
+ if int(data.Idx) < 0 || int(data.Idx) >= len(data.Topics) {
return nil, errors.New("topic index out of range")
}
return pongpkt.data.(*pong), nil